Jspdf-autotable: Table height is always 0

Created on 24 Feb 2020  路  2Comments  路  Source: simonbengtsson/jsPDF-AutoTable

  doc.autoTable({
    startY: 50,
    head: [['Feld', 'Wert']],
    columnStyles: {
      0: { cellWidth: 120 },
      1: { cellWidth: 60 }
    },
    didParseCell: HookData => {
      console.log(HookData); // <- height is set and has value 
      console.log(HookData.table.height);  // <- height is 0 ????
      tableHeight = HookData.table.height;
    },
    body: tableDataArray
  });

In the didParseCell-Hook I get the HookData nad the height is set to the actual height of the table, but if i print out the HookData.table.height the height is 0, why that?

question stale

Most helpful comment

Use 'didDrawPage' instead of 'didParseCell'.

All 2 comments

Use 'didDrawPage' instead of 'didParseCell'.

This issue has been automatically closed since the issues in this project are mainly used for bugs and feature requests. Questions are directed to stackoverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AminBangash picture AminBangash  路  5Comments

ayozebarrera picture ayozebarrera  路  3Comments

azakordonets picture azakordonets  路  5Comments

simonbengtsson picture simonbengtsson  路  4Comments

simonbengtsson picture simonbengtsson  路  5Comments