Page breaks in a table

I'm trying to make reports in HTML, everything works fine except one. I have several delivery locations that are grouped. Imagine a group of addresses in a specific area of ​​a ZIP code. These groups cannot exceed the page, but in order to minimize paper waste, I want to add more of these groups to them. I use WKHTMLtoPDF to create a PDF file, and everything looks great except when I try to force a page break. I used several suggested options, for example

<tr class="pageBreak" style="display: block;"></tr>
<tr style="display: block;"><td colspan="10"><p class="pageBreak">&nbsp;</p></tr>

Via:

page-break-after: always !important;

But every attempt I get a very large cell on the next page See an example

I can’t understand how this is happening and how to prevent it. I already set the line height to 1px, and that doesn't help either. (My HTML is valid)

I know that webkit is a (slightly) buggy with tables, but this is the last thing I need to figure out to make this work.

Update I found someone who (I think) has the same problem, so I think I can not continue. Are there any other good html2pdf converters? https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1640

Sincerely yours, Tim

+4
source share
1 answer

I had this problem and I knew what the solution was to come through it, here is my question ... and check my answer below the question. How to achieve page break in HTML table for Google Chrome?

+1
source

Source: https://habr.com/ru/post/1545674/


All Articles