Files
docx-js/ts/docx/table/grid.ts

18 lines
470 B
TypeScript
Raw Normal View History

2017-03-07 19:22:10 +01:00
import {XmlComponent, Attributes} from "../xml-components";
export class TableGrid extends XmlComponent {
private cols: Array<GridCol>;
constructor(cols: Array<GridCol>) {
super('w:tblGrid');
this.cols = cols;
cols.forEach(col => this.root.push(col));
}
}
export class GridCol extends XmlComponent {
constructor(width?: number) {
super('w:gridCol');
this.root.push(new Attributes({w: width.toString()}))
}
}