Fix spelling of "margin"

This commit is contained in:
Nick Georgiou
2019-04-18 13:55:18 +10:00
parent b0f8f8ddbd
commit 29f890918c
11 changed files with 80 additions and 80 deletions

View File

@ -0,0 +1,63 @@
// http://officeopenxml.com/WPtableCellProperties-Margins.php
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
export interface ICellMarginProperties {
readonly type: string;
readonly width: number;
}
class CellMarginAttributes extends XmlAttributeComponent<ICellMarginProperties> {
protected readonly xmlKeys = { width: "w:w", type: "w:type" };
}
export class TopCellMargin extends XmlComponent {
constructor(value: number) {
super("w:top");
this.root.push(
new CellMarginAttributes({
width: value,
type: "dxa",
}),
);
}
}
export class BottomCellMargin extends XmlComponent {
constructor(value: number) {
super("w:bottom");
this.root.push(
new CellMarginAttributes({
width: value,
type: "dxa",
}),
);
}
}
export class LeftCellMargin extends XmlComponent {
constructor(value: number) {
super("w:start");
this.root.push(
new CellMarginAttributes({
width: value,
type: "dxa",
}),
);
}
}
export class RightCellMargin extends XmlComponent {
constructor(value: number) {
super("w:end");
this.root.push(
new CellMarginAttributes({
width: value,
type: "dxa",
}),
);
}
}