fix: table width in percentage should include '%'
This commit is contained in:
@ -15,6 +15,7 @@ class TableWidthAttributes extends XmlAttributeComponent<ITableWidth> {
|
|||||||
export class PreferredTableWidth extends XmlComponent {
|
export class PreferredTableWidth extends XmlComponent {
|
||||||
constructor(type: WidthType, w: number) {
|
constructor(type: WidthType, w: number) {
|
||||||
super("w:tblW");
|
super("w:tblW");
|
||||||
this.root.push(new TableWidthAttributes({ type, w }));
|
const width: number | string = type === WidthType.PERCENTAGE ? `${w}%` : w;
|
||||||
|
this.root.push(new TableWidthAttributes({ type: type, w: width }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user