Repeat Item Table Header Overlap


I have problem when generating pdf for quotation, when items table more than 1 page then the Items Table Header on the next page is overlap within items table list on standard print format. you can see on pic below

any idea how to solved this problem?

ERPNext: v12.0.8 (version-12)
Frappe Framework: v12.0.8 (version-12)
wkhtmltopdf 0.12.5 (with patched qt)

1 Like

@ical any fix that you’ve been able to find yet?

Same problem for custom (HTML) print formats.

not yet
I try adding this to css custom print format properties, it’s make better but the table header not repeated

thead {
display: table-row-group;
tfoot {
display: table-row-group;
tr { 
page-break-inside: avoid;

For now I think it’s better than before
is there any better solution?

Has anyone found a workaround or solution for this?

I was able to avoid this if there are multiple rows by avoiding page break by CSS code but if one single line item has description spanning over more than 1 page, there doesn’t seem to be any solution.

We found a workaround which seems to be the best way out at the moment.
Before we get into the workaround, let me try to explain the problem
Origin: Problem is with wkhtmltopdf, this problem seems to persist since a long time and has been reported even on Odoo forums
Problem: When the description of a line item is too long, wkhtmltopdf does not wrap text or add a page break automatically and that is the reason why the content gets overlapped on the next page’s header
Possible Workaround/Solution:
Case 1: When the line item in question, which is getting overlapped
a. is one of many line items in the given document and
b. the description of given line item is equal to or less than one page height
Solution: In this case your best bet is to introduce a avoid page break tag in CSS
thead { display: table-header-group; } tfoot { display: table-row-group; } tr { page-break-inside: avoid; }
Courtesy: html - wkhtmltopdf thead overlapps content on second page - Stack Overflow
Case 2: When Description or text in question spans over 1 page height
This is a tricky one. The above CSS fix won’t fix this case.
In order to fix this we looked up the

number by Inspecting the overlapping content and added padding just before this div to make it wrap over to the next page

table tbody tr td div.value > :nth-last-child(4) { padding-bottom: 50px; }
Hope this helps

1 Like

tr {page-break-inside: avoid;}

This Works for me.