This is the result when i use Wicked_pdf to convert my html.erb
page to pdf
.
Problem: Seem table
's tr
has been splitted into two pages.
What i tried without success:
table, tr, td, th, tbody, thead, tfoot { page-break-inside: avoid !important; }
Another option: place each tr in its own tbody and then apply the peage break css rules to the tbody. Tables support multiple tbodys. A bit of extra markup, but works decently for me.
I am using Ruby on Rails 4.2.6, Wicked_pdf latest version, bootstrap.
Relate issue on github
Question: How can i make table
's tr
not split into two pages.
well, to solve this you have to user page-break-inside: avoid !important;
with the repeated div the results in this overflow.
like if you have:
<div class="main">
<div class="article">
...
</div>
<div class="article">
...
</div>
<div class="article">
...
</div>
...
...
...
</div>
which results in overflow that will make things overlap with the header within the page breaks..
so >> use: page-break-inside: avoid !important;
with this class article
.
table.report-container div.article {
page-break-inside: avoid;
}
---> here is a full answer to print a page properly using html/css