Alignment of tables

This commit is contained in:
Dolan Miu
2019-11-24 01:22:17 +00:00
parent 1bdc93ef59
commit 8bdbd1de39
5 changed files with 61 additions and 2 deletions

View File

@ -1,5 +1,7 @@
// http://officeopenxml.com/WPtableGrid.php
import { XmlComponent } from "file/xml-components";
import { AlignmentType } from "../paragraph";
import { TableGrid } from "./grid";
import { TableCell, VerticalMergeType, WidthType } from "./table-cell";
import { ITableBordersOptions, ITableFloatOptions, TableProperties } from "./table-properties";
@ -33,6 +35,7 @@ export interface ITableOptions {
readonly float?: ITableFloatOptions;
readonly layout?: TableLayoutType;
readonly borders?: ITableBordersOptions;
readonly alignment?: AlignmentType;
}
export class Table extends XmlComponent {
@ -46,6 +49,7 @@ export class Table extends XmlComponent {
float,
layout,
borders,
alignment,
}: ITableOptions) {
super("w:tbl");
this.properties = new TableProperties();
@ -103,5 +107,9 @@ export class Table extends XmlComponent {
if (layout) {
this.properties.setLayout(layout);
}
if (alignment) {
this.properties.setAlignment(alignment);
}
}
}