0.6.0 Beta issue with thead and tbody over page break

883 views
Skip to first unread message

William Jensen

unread,
Oct 8, 2014, 9:25:55 AM10/8/14
to dom...@googlegroups.com


   I like the new beta release but I note that when a page breaks inside a table with <thead>, <tbody> and no <tfoot> set the bottom of the first page table is not closed(missing bottom of the cell row). Then the new <thead> on the following page is missing the top line of the table. 

this is with using the following in the CSS file:

table {page-break-inside:auto;}
tr    {page-break-inside:avoid; page-break-after:auto;}




BrianS

unread,
Oct 9, 2014, 9:09:36 PM10/9/14
to dom...@googlegroups.com
I have, so far, been unable to reproduce the issue. It would help to have some sample HTML that exhibits the problem when rendered by dompdf.

William Jensen

unread,
Oct 9, 2014, 11:02:13 PM10/9/14
to dom...@googlegroups.com
I have attached the files that I am generating the PDF's from this is a modified file based on openCart 1.5.4.1 admin invoice.
invoice_pdf.css
order_invoice_pdf.tpl

William Jensen

unread,
Oct 19, 2014, 6:23:01 PM10/19/14
to dom...@googlegroups.com
Fix found first the table not closing from page break

Found if I changed the CSS files

border-collapse: collapse;
to
border-spacing: -1px;

Then to fix the missing top on following page:

From my .product {
Moved
border-top: 1px solid #DDDDDD;

To new
thead {
border-top: 1px solid #DDDDDD;
}

So looks like border-collapse: collapse; is not working for tables or there is some other bug.

BrianS

unread,
Oct 20, 2014, 10:57:42 PM10/20/14
to dom...@googlegroups.com
Can you post the actual HTML rendered by dompdf? The template is ok, but then I have to go through and fill in the variable references. You can call $dompdf->output_html() after loading the document to get a copy of the HTML dompdf is using.

William Jensen

unread,
Oct 22, 2014, 10:27:32 AM10/22/14
to dom...@googlegroups.com
I have attached the Old_invoice.pdf and fixed file with the css changes listed above see Invoice_example.pdf. Also note this is running new DOMPDF 0.6.1 to get inline php for page number to work. I see from other discussion that css border-collapse: collapse; was a issue so that might be the problem with the bottom of the first page table the top of the new thead should have a top add automatic as that is a normal part of using <thead>. To work around I moved the css border-top and add a new css class for  <tead> with the border-top in-side. This fixed my problem.
Invoice_example.pdf
Old_invoice.pdf

William Jensen

unread,
Oct 22, 2014, 10:37:27 AM10/22/14
to dom...@googlegroups.com
Opps for got to past the html file here is the file. 
Order_4568.html

William Jensen

unread,
Oct 22, 2014, 10:42:32 AM10/22/14
to dom...@googlegroups.com
Ignore the last file I did the wrong thing
Order_4568.html

BrianS

unread,
Oct 23, 2014, 11:18:18 AM10/23/14
to dom...@googlegroups.com
OK, now I'm seeing it. I think the issue is specific to your styling. Some of it may be how we've implemented collapsible borders.

You see a similar issue when printing from Firefox on the second page. The more straightforward fix for this would be to keep your original CSS and apply a table border. With table-collapse set you don't have to worry about overly-large borders because they should combine.

The missing border on the first page does appear to possibly be a bug. I couldn't really find an acceptable solution to that problem, but I'll keep at it.

Of course, you have a work-around so you may not need to do anything moving forward unless you run into other issues.

William Jensen

unread,
Oct 23, 2014, 9:09:31 PM10/23/14
to dom...@googlegroups.com

Well my work around is works great just letting you know what I found and best of luck I look forward to enjoying this for a long time. Keep up the great work.
Reply all
Reply to author
Forward
0 new messages