-
-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table styles don't work in online word #877
Comments
I think the problem is the column widths: {
"deleted": false,
"rootKey": "w:tblGrid",
"root": [
{
"deleted": false,
"rootKey": "w:gridCol",
"root": [
{
"deleted": false,
"rootKey": "_attr",
"root": {
"w": 100
},
"xmlKeys": {
"w": "w:w"
}
}
]
},
{
"deleted": false,
"rootKey": "w:gridCol",
"root": [
{
"deleted": false,
"rootKey": "_attr",
"root": {
"w": 100
},
"xmlKeys": {
"w": "w:w"
}
}
]
}
]
} if you don't specify them, they are initialized with I found this works for me best: const tbl = new Table({
rows,
width: {
size: 5000,
type: WidthType.PERCENTAGE,
},
});
const grid = findXMLComponent(tbl, 'w:tblGrid');
if (grid) {
tbl.root.splice(tbl.root.indexOf(grid), 1);
} |
Yup, it's set to 100 by default on purpose (I randomly picked 100 at the time of writing the code) So this is a non-issue I suppose? |
yes, it is an issue. if you omit the |
Makes sense, will make a fix |
…n some word processors
Online word has problems with custom table styles.
for example the https://github.com/dolanmiu/docx/blob/master/demo/25-table-xml-styles.ts demo produces this in word:
but this in online word:
tested with
docx-6.0.3
The text was updated successfully, but these errors were encountered: