I have a long table that shows rows on several pages. When the page ends, the line is printed half on one page and half on the next page. How can I make sure the lines are printed completely on a new page?
CSS property: element page-break-inside: avoid; on HTML tr does this.
page-break-inside: avoid;
HTML tr
Tested:wkhtmltopdf 0.12.3 for Linux (Ubuntu Trusty) 32-bit / 64-bit built on Ubuntu 14.04.2 , as indicated at: http://wkhtmltopdf.org/downloads.html#stable
wkhtmltopdf 0.12.3
Linux (Ubuntu Trusty) 32-bit / 64-bit built on Ubuntu 14.04.2
A quick and dirty test might look like this:
<tr style="page-break-inside: avoid;"> <!-- A little border to see the result more easily --> <td style="border: solid 1px blue;"> Large text possibly displayed on several pages ... Large text possibly displayed on several pages ... Large text possibly displayed on several pages ... Large text possibly displayed on several pages ... </td> <td>col2</td> <td>col3</td> </tr>
Mozilla Developer Network Browser Description
Not working for me. Tested with wkhtmltopdf 0.12.4 Linux 64 bit. Style applied with
thead, tr, td, th { page-break-inside: avoid !important; }
Lines continue to break in the middle and overlap the ted on the next page.
Source: https://habr.com/ru/post/1245480/More articles:how to save space in HTML code selection list hi - javascriptWhy is the minimum granularity defined as 8192 in Java8 for moving from parallel sorting to a .sort array regardless of data type - javaspring + hibernation integration missing Table "table_name" missing - springThe most efficient way to transform / move a large number of DOM elements - javascriptC ++: How does the compiler know how much memory is allocated for each stack of frames? - c ++Link to nested class objects in C # - stringGatling: how to set up and teardown script - stress-testingCall a new date with the union type "numberMinimum size for custom views - swiftCheck for unwanted wildcard dependencies recursively - rustAll Articles