Update demos

This commit is contained in:
Dolan
2018-09-13 01:54:37 +01:00
parent f1b176670c
commit a9167b4809
2 changed files with 27 additions and 6 deletions

View File

@ -5,20 +5,33 @@ import { Document, Packer, Paragraph } from "../build";
const doc = new Document();
const table = doc.createTable(2, 2);
table
doc
.createTable(2, 2)
.getCell(0, 0)
.addContent(new Paragraph("Hello"))
.setHorizontalSpan(2);
doc.createParagraph("Another table").heading2();
const table2 = doc.createTable(2, 3);
table2
doc
.createTable(2, 3)
.getCell(0, 0)
.addContent(new Paragraph("World"))
.setHorizontalSpan(3);
doc.createParagraph("Another table").heading2();
const table = doc.createTable(2, 4);
table
.getCell(0, 0)
.addContent(new Paragraph("Foo"))
.setHorizontalSpan(4);
table.getCell(1, 0).addContent(new Paragraph("Bar1"));
table.getCell(1, 1).addContent(new Paragraph("Bar2"));
table.getCell(1, 2).addContent(new Paragraph("Bar3"));
table.getCell(1, 3).addContent(new Paragraph("Bar4"));
const packer = new Packer();
packer.toBuffer(doc).then((buffer) => {