added fixedWidthLayout option and method

This commit is contained in:
felipe
2017-03-11 09:59:29 +01:00
parent 210b97d00b
commit c10b576a3a
4 changed files with 48 additions and 0 deletions

View File

@ -11,6 +11,11 @@ export class TableProperties extends XmlComponent {
this.root.push(new PreferredTableWidth(type, w));
return this;
}
public fixedWidthLayout(): TableProperties {
this.root.push(new TableLayout("fixed"));
return this;
}
}
interface ITableWidth {
@ -28,3 +33,16 @@ class PreferredTableWidth extends XmlComponent {
this.root.push(new TableWidthAttributes({type, w}));
}
}
type tableLayout = "autofit" | "fixed";
class TableLayoutAttributes extends XmlAttributeComponent<{type: tableLayout}> {
protected xmlKeys = {type: "w:type"};
}
class TableLayout extends XmlComponent {
constructor(type: tableLayout) {
super("w:tblLayout");
this.root.push(new TableLayoutAttributes({type}));
}
}