How to set horizontal margin for google docs #1175
-
Hello @dolanmiu, first congratulations on this amazing library! I'm facing a small issue where a document generated and imported into Google Docs, doesn't apply the horizontal margins I set in the table cells. Here's the comparison: Here is the code snippet that sets the margins: const defaultTableCellOpts = {
margins: {
bottom: convertInchesToTwip(0.05),
left: convertInchesToTwip(0.1),
right: convertInchesToTwip(0.1),
top: convertInchesToTwip(0.05),
},
}; Does anyone know a way to make Google Docs apply horizontal margins? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I managed to solve it and the solution is very simple. I was defined as margins in each table cell, example: new TableCell({
margins: {
top: convertInchesToTwip(0.05),
bottom: convertInchesToTwip(0.05),
right: convertInchesToTwip(0.09),
left: convertInchesToTwip(0.09),
},
}); Just remove from cells, and move to the table itself: new Table({
margins: {
top: convertInchesToTwip(0.05),
bottom: convertInchesToTwip(0.05),
right: convertInchesToTwip(0.09),
left: convertInchesToTwip(0.09),
},
}); And that's it! Running Perfectly on Google Docs Now! |
Beta Was this translation helpful? Give feedback.
I managed to solve it and the solution is very simple.
I was defined as margins in each table cell, example:
Just remove from cells, and move to the table itself:
And that's it! Running Perfectly on Google Docs Now!