Remove Table Borders In DOCX JS

JavaScript

13/10/2022


Removing the borders of a table is not so obvious, 🤔 especially if you draw your experience from CSS. The existing solution to achieving this goal is to simply define the border color as white, giving the appearance that they have been removed.

In a DOCX table, borders are defined on a cell level.

JAVASCRIPT
new TableCell({
borders: {
top: { color: "FFFFFF" },
bottom: { color: "FFFFFF" },
left: { color: "FFFFFF" },
right: { color: "FFFFFF" },
},
})

WRITTEN BY

Code and stuff