Merge pull request #844 from dolanmiu/feat/fix-styles-xml

#842 Move table styles to the top
This commit is contained in:
Dolan
2021-03-22 11:46:12 +00:00
committed by GitHub

View File

@ -31,6 +31,10 @@ export class TableProperties extends IgnoreIfEmptyXmlComponent {
constructor(options: ITablePropertiesOptions) { constructor(options: ITablePropertiesOptions) {
super("w:tblPr"); super("w:tblPr");
if (options.style) {
this.root.push(new TableStyle(options.style));
}
this.root.push(new TableCellMargin(options.cellMargin || {})); this.root.push(new TableCellMargin(options.cellMargin || {}));
if (options.borders) { if (options.borders) {
@ -60,9 +64,5 @@ export class TableProperties extends IgnoreIfEmptyXmlComponent {
if (options.visuallyRightToLeft) { if (options.visuallyRightToLeft) {
this.root.push(new VisuallyRightToLeft()); this.root.push(new VisuallyRightToLeft());
} }
if (options.style) {
this.root.push(new TableStyle(options.style));
}
} }
} }