table header documentation is incorrect
table.getRow(0).setTableHeader(); is not in the library but explained in the documentation. I am using docxjs in the browser so the version might not have the functionality. Do give a look.
Will do
I have passed header and rows in tablerow children as per below but i am not able to open document it shows me incorrect content..is there any solution for adding header on table dynamically ?
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
children:headers
}),
new TableRow({
children: rows
}),
]
})
Documenation is now correct: https://docx.js.org/#/usage/tables
@piyushdp333 please follow the example carefully, each row must have cells:
https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts
https://github.com/dolanmiu/docx/blob/master/demo/31-tables.ts example does not cover mentioned issue... How the tableHeader should be defined? is it first TableRow as defauld? Is any TableHeader constructor? thx for response!