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,7 +1,8 @@
// Example of how you would merge cells together (Rows and Columns) and apply shading
// Also includes an example on how to center tables
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, HeadingLevel, Packer, Paragraph, ShadingType, Table, TableCell, TableRow, WidthType } from "../build";
import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, ShadingType, Table, TableCell, TableRow, WidthType } from "../build";
const doc = new Document();
@ -29,6 +30,7 @@ const table = new Table({
});
const table2 = new Table({
alignment: AlignmentType.CENTER,
rows: [
new TableRow({
children: [
@ -66,6 +68,7 @@ const table2 = new Table({
});
const table3 = new Table({
alignment: AlignmentType.CENTER,
rows: [
new TableRow({
children: [