Node-html-pdf: thead and tbody get mixed starting from second page

Created on 17 Jul 2015  路  11Comments  路  Source: marcbachmann/node-html-pdf

I'm creating a pdf from a html with thead and tbody tags, I have already removed all style I had and I'm still with the same problem.

Starting from second page the tbody overwrite thead, like on image bellow:

screen shot 2015-07-17 at 11 24 02

It is very strange because it works on the first page (image below) and I don't have any style on this page.

screen shot 2015-07-17 at 11 26 10

It seems to happened too with the guy who opened this issue: https://github.com/marcbachmann/node-html-pdf/issues/36. But he didn't want to have table headers on all pages, I want to.

Do you ever experienced this problem? Is there a way to solve it?

Most helpful comment

Same here. Did you find a workaround in the meantime @sonu27?

All 11 comments

Is there any known solution?

Having the same issue here.

Any luck?

@kodamirmo In the latest release of nodeice, I switched to the phantom-html-to-pdf package by @pofider which doesn't have this bug. :sparkles:

@IonicaBizau and @kodamirmo .... phantom-html-to-pdf has the same bug if you set the orientation the landscape :-(

pageSize: {
     orientation: 'landscape'
}

Sitting the proper css rules seemed to work for me:

thead {
  display: table-header-group;
}

tr {
  page-break-inside: avoid;
}

Headers repeated correctly without overlap. One trick is that you can't have any of those rules inside of a @print media rule, as it seems that it can't calculate the repeating headers correctly when doing so.

I seem to be unable to get this to work on my end. A working example of this would be greatly appreciated :)

I've been unable to get it to repeat headers, using v2.1 of this lib. Any update?

This might be related: https://github.com/ariya/phantomjs/issues/13324 https://github.com/ariya/phantomjs/issues/13524

Same here. Did you find a workaround in the meantime @sonu27?

Hi,

table thead section is not repeating after page break. I am using simple html.









header
data

Is anyone found solution?

Regards,
Rohit

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmoulliard picture cmoulliard  路  3Comments

ascsi picture ascsi  路  3Comments

hishamabutt picture hishamabutt  路  4Comments

OussamaRomdhane picture OussamaRomdhane  路  4Comments

B-StS picture B-StS  路  5Comments