Files
docx-js/src/file/table/table-cell/cell-margin/table-cell-margins.ts

22 lines
753 B
TypeScript
Raw Normal View History

2019-04-18 13:55:18 +10:00
// http://officeopenxml.com/WPtableCellProperties-Margins.php
import { XmlComponent } from "file/xml-components";
import { BottomCellMargin, LeftCellMargin, RightCellMargin, TopCellMargin } from "./cell-margin";
export interface ITableCellMarginOptions {
readonly top?: number;
readonly left?: number;
readonly bottom?: number;
readonly right?: number;
}
export class TableCellMargin extends XmlComponent {
constructor({ top = 0, left = 0, right = 0, bottom = 0 }: ITableCellMarginOptions) {
super("w:tcMar");
this.root.push(new TopCellMargin(top));
this.root.push(new LeftCellMargin(left));
2019-04-18 13:55:18 +10:00
this.root.push(new BottomCellMargin(bottom));
this.root.push(new RightCellMargin(right));
}
}