Make .addSection fully declarative

This commit is contained in:
Dolan
2021-03-19 20:53:56 +00:00
parent 4783812044
commit 3299c557a0
86 changed files with 3341 additions and 3278 deletions

View File

@ -15,8 +15,6 @@ import {
VerticalAlign,
} from "../build";
const doc = new Document();
const table = new Table({
rows: [
new TableRow({
@ -160,7 +158,9 @@ const noBorderTable = new Table({
],
});
doc.addSection({ children: [table, new Paragraph("Hello"), noBorderTable] });
const doc = new Document({
sections: [{ children: [table, new Paragraph("Hello"), noBorderTable] }],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);