-
Notifications
You must be signed in to change notification settings - Fork 1.8k
overlapping text when repeating headers/footers in table #1524
Comments
Nope, that is a part of the patched QT and can't be controlled. If you want, you can compile your own fork where it is disabled. If you want, post examples of what weird results you are getting -- first check if your HTML is correct. |
The HTML: The Header: The Footer: Settings: On page 5 of the PDF, we get overlappsed text. |
Can you post screenshots? I don't know which platform you are testing this on.. |
This is on Windows x64 (Windows 2008 R2) Here is the PDF: Page 5. |
Can you check if it works better with the 32-bit version? Also, check if you get better/different results on a Windows XP/7 machine (not server), as there seems to be some issues with Windows Server 2008. |
Hello, I have done some tests. 32/64 bit on Windows Server 2008 produces the exact same problem. 32bit on Windows 7 produces the exact same problem. 64 bit not tested on Win7 as i dont see the issue is there. |
@rnenjoy: do you mean to say on Windows 7, 64-bit the issue is not there or you have not tested it? |
@ashkulz I have tested it now. Same error on Windows 7 x64. |
@ashkulz thanks for your great work!! |
Unsure if I can offer a solution to this for you, but I found this issue while Google-ing for the same issue. My table is inside a DIV which has the CSS property overflow-x: auto; If I switch it to overflow-x: visible; instead this problem goes away. So assuming you're using the --print-media-type parameter of wkhtmltopdf, you can smash it with a CSS media query so it doesn't affect the browsers output. @media print {
.element-that-contains-table {
overflow: visible !important;
}
} Hope that helps you with both a temporary solution and a possible permanent fix for this issue. |
@quickstick: I'll make sure to document that, but I don't think it is applicable in the above test case -- it doesn't have an |
This isn't fixed for me. If I set overflow-x on body to hidden, table headers don't appear to have any height. If I set the thead display property to something like table-cell, the height is fixed, but the header only occupies one cell and causes problems with the rest of the table. If I set the div containing the table to allow overflow, the problem is not resolved. Ex:
If I don't hide the x overflow on the body, the table exceeds the page width, and qt scales the contents even if I've specified otherwise with wkhtmltopdf. |
@inferiorhumanorgans: I don't think that the issue is solved, hence it is still open. |
I found a solution! For printing the report instead of leaving the table footer tag I used it as a a normal tr tag and now it wont repeat the footer of the table. |
I can confirm this issue. Can't provide a test-case just yet, but I have one "master table" which contains a single thead, many tbody then one tfoot. For SOME tbody instances (a specific pattern that I'm trying to abstract for the sake of this issue), the content starts at the top of the page, overlapping the thead. For others though, it does not so the issue isn't even consistent within one document except that is a particular type of content. I'll report back if I can find the pattern in a more simplified, repeatable way. |
I'm having the same issue. Has there been any update to this or any workaround suggestions? Right now on one of our tables on our production server, text commonly overlaps the table headers. |
I had a lot of padding at the bottom of my tables, which are all dynamic so had to make sure they had spacing in between. As of right now, it appears taking away the padding-bottom from my tables and adding a bunch of |
Have same troubles with NReco.PdfGenerator v1.1.15 (based on wkhtmltopdf). I have some tables, placed one-by-one in html. Each table have one header inside "thead" tag: CSS:
HTML:
While generating PDF, i got headers repeating on each page, that exactly what i need. I tried to fix it with adding empty "hack" table between existing tables: CSS (note: "page-break-inside: auto;"):
HTML:
And it's worked! But, most strange thing - if i remove "padding: 0; margin: 0;" from css rules, issue comes again, and headers again overlapping! It's unbeliveable. Proofs (on pics "border: none;" removed from css): Don't know why "padding: 0; margin: 0;" gives this effect... It's very strange. |
I am using mpdf with yii 1.1, in which i have a pdf to show report. Pdf has head, contents(table) footer (contains legends of table columns). issue is that when footer legends contents getting increased it overlaps the contents data with each other. |
Only way I could resolve this myself is with long table heights and overlapping text was to change the paper size to |
Thanks but I am supposed to do this on A-4 Landscape page. |
With new releases on the 0.12.x branch, the docker container is experiencing the following issues: - wkhtmltopdf/wkhtmltopdf#1524 - wkhtmltopdf/wkhtmltopdf#3241
Hi guys. So whoever finds it banging his head against the wall trying to solve issues with |
I had the same issue. The most discussed solution below did not resolve the issue.
Eventually I found that one of the parent divs for the table had position:relative; top:40px. This seems to confuse Chrome.
Chrome should be fixed so that thead location is not confused by relative positioning of a parent div. See attached jsfiddle for example of the issue: |
With the same command line parameters, wkhtmltopdf/wkhtmltopdf#1524 and wkhtmltopdf/wkhtmltopdf#3241 will affect Colore output. Until we have PDF output comparison tests, it is not worth to update this library
With the same command line parameters, wkhtmltopdf/wkhtmltopdf#1524 and wkhtmltopdf/wkhtmltopdf#3241 will affect Colore output. Until we have PDF output comparison tests, it is not worth to update this library [ci skip]
With the same command line parameters, wkhtmltopdf/wkhtmltopdf#1524 and wkhtmltopdf/wkhtmltopdf#3241 will affect Colore’s PDF output. PDF comparison specs are required to update this library [ci skip]
With the same command line parameters, wkhtmltopdf/wkhtmltopdf#1524 and wkhtmltopdf/wkhtmltopdf#3241 will affect Colore’s PDF output. PDF comparison specs are required to update this library [ci skip]
If a table is enclosed in a |
With the same command line parameters, wkhtmltopdf/wkhtmltopdf#1524 and wkhtmltopdf/wkhtmltopdf#3241 will affect Colore’s PDF output. PDF comparison specs are required to update this library [ci skip]
None of the above cases work for me. If the cell is larger than the page. Is there any solution? HTML: https://jsfiddle.net/htLwdprc/ |
I have solved my problem by adding: |
Adding Fixed it for me. |
With the same command line parameters, wkhtmltopdf/wkhtmltopdf#1524 and wkhtmltopdf/wkhtmltopdf#3241 will affect Colore’s PDF output. PDF comparison specs are required to update this library [ci skip]
With the same command line parameters, wkhtmltopdf/wkhtmltopdf#1524 and wkhtmltopdf/wkhtmltopdf#3241 will affect Colore’s PDF output. PDF comparison specs are required to update this library [ci skip]
With the same command line parameters, wkhtmltopdf/wkhtmltopdf#1524 and wkhtmltopdf/wkhtmltopdf#3241 will affect Colore’s PDF output. PDF comparison specs are required to update this library [ci skip]
rowspans create this for me. i either don't understand how break-inside is supposed to work or the library doesn't apply it. adding empty tr at the end of a rowspanned section makes the result presentable. sample python fix:
|
in the case of .table-responsive as a table wrapper, we should unset overflow-x
|
After testing many of the solutions both here and in other pages, AcroKostya's is the one that worked for me (since I specifically need the repeating header). By doing some tests I could notice that if I deactivated the css for the template I'm using, this issue would disappear (with the added effect of losing the custom table design), but it took me this answer to effectively identify the sole cause of the issue, which was a content-wrapper div that uses flex. |
It worked for me not using the "thead" tag |
When having a big table with lots of rows, or many tables with 10-20 rows, sometimes the feature that repeats the thead/tfoot when there is a page break causes weird results.
Like a tfoot is moved to page one, and is displayed above some other text.
Can this feature be turned off?
The text was updated successfully, but these errors were encountered: