docx icon indicating copy to clipboard operation
docx copied to clipboard

table header documentation is incorrect

Open kamranmuazzam opened this issue 7 years ago • 4 comments

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.

kamranmuazzam avatar May 01 '19 05:05 kamranmuazzam

Will do

dolanmiu avatar May 01 '19 10:05 dolanmiu

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
            }),
          ]
           
          
        })

piyushdp333 avatar Dec 16 '20 17:12 piyushdp333

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

dolanmiu avatar Dec 24 '20 01:12 dolanmiu

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!

vooit avatar Apr 26 '21 13:04 vooit