Jspdf-autotable: Issue with rowspan table

Created on 14 Jan 2019  路  11Comments  路  Source: simonbengtsson/jsPDF-AutoTable

The following table will render fine in the browser:

<table class="table table-dark" id="my-table" >
  <tbody>
 <tr>
  <th rowspan="3">Details</th>
  <th>Name</th>
  <td>Sarmad</td>
 </tr>
 <tr>
  <th>ABN</th>
  <td>111000333</td>
 </tr>
 <tr>
  <th>Reg Add</th>
  <td>Tpwer 1</td>
 </tr>
  </tbody>
</table>

Using AutoTable {html: '#my-table'} to create the pdf, it seems to ignore one of the TDs

Currently, I solved the issue by adding an extra empty tag on top

<table class="table table-dark" id="my-table" >
  <tbody>
 <tr>
  <th rowspan="3">Details</th>
  <th>Name</th>
  <td>Sarmad</td>
 </tr>
 <tr>
  <th></th>
  <th>ABN</th>
  <td>111000333</td>
 </tr>
 <tr>
  <th></th>
  <th>Reg Add</th>
  <td>Tpwer 1</td>
 </tr>
  </tbody>
</table>

However that will break the HTML table.

bug help wanted

All 11 comments

You're mixing th's and td's. What happens when you put all th's in a thead tag?

The same

@Et3rnal I'm having a similar issue, have you found any solutions for this one ?

what I get when I print

screen shot 2019-01-28 at 12 49 44 pm

what it should look like ( as visible in the browser )

screen shot 2019-01-28 at 12 49 34 pm

Nested Tables also do not seem to work ( which makes sense )

working on this right now, will put PR up when done

441

@Et3rnal once the PR is merged please pull latest and try again !

woooooooooooops my bad

new PR #443

Fixed #445 now which is most likely the same issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

azakordonets picture azakordonets  路  5Comments

cwolcott picture cwolcott  路  4Comments

prakashsam picture prakashsam  路  4Comments

mmghv picture mmghv  路  4Comments

tapz picture tapz  路  3Comments