Files
docx-js/src/file/table/table-properties/table-layout.ts

18 lines
495 B
TypeScript
Raw Normal View History

2018-10-23 23:44:50 +01:00
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
export enum TableLayoutType {
AUTOFIT = "autofit",
FIXED = "fixed",
}
class TableLayoutAttributes extends XmlAttributeComponent<{ readonly type: TableLayoutType }> {
protected readonly xmlKeys = { type: "w:type" };
2018-10-23 23:44:50 +01:00
}
export class TableLayout extends XmlComponent {
constructor(type: TableLayoutType) {
super("w:tblLayout");
this.root.push(new TableLayoutAttributes({ type }));
}
}