initial attempt at Table

This commit is contained in:
felipe
2017-03-07 19:22:10 +01:00
parent 0de30f6c59
commit f1fb0c4f22
6 changed files with 131 additions and 3 deletions

17
ts/docx/table/grid.ts Normal file
View File

@ -0,0 +1,17 @@
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()}))
}
}