Make table internals declarative
This commit is contained in:
@ -13,7 +13,7 @@ class TableWidthAttributes extends XmlAttributeComponent<ITableWidth> {
|
||||
}
|
||||
|
||||
export class PreferredTableWidth extends XmlComponent {
|
||||
constructor(type: WidthType, w: number) {
|
||||
constructor(type: WidthType = WidthType.AUTO, w: number) {
|
||||
super("w:tblW");
|
||||
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