3

I wanted to generate 2 pages pdf with dompdf but this is the result i have get till now.

As you can see the table content overlaps in the page 1 and dont make a page break to display the rest of the table content.

my table have this css properties

<table class="products-table" style="position:absolute; page-break-after:always; page-break-inside:always;">
 .... table content (this table contains another tables inside)
</table>

This is the current result:

enter image description here

Thanks in advance :)

martinezjc
  • 3,415
  • 3
  • 21
  • 29
  • I don't think tables will break between pages (certainly not easily, though perhaps you can do it in the CSS for rows). Although this is a grid layout, it doesn't look like tabular data, so I guess it's the old question of, are you sure you need to use tables and not collections of `inline-block` elements? – DanielM Apr 13 '15 at 22:56
  • i was thinking to do with inline elements and not with tables, but are you sure this can't be done with tables? – martinezjc Apr 14 '15 at 13:46
  • 1
    Not 100% but you have DOMPDF right there, try a test. :) Try two rows, one cell in each. Make the rows very high and see if it breaks onto two page. Try this CSS to see if that fixes it http://stackoverflow.com/questions/8712677/how-to-apply-css-page-break-to-print-a-table-with-lots-of-rows – DanielM Apr 14 '15 at 13:50
  • works now but insert too many white pages between tables :\ – martinezjc Apr 14 '15 at 14:08
  • I don't think I can be of any more use without seeing a lot more code. It also occurs to me that having tables inside tables is highly likely to wreck your day. If it doesn't need to be tabular, I'd say don't make it tabular. – DanielM Apr 14 '15 at 15:06
  • dompdf can break tables across pages, but not individual table cells. – BrianS Apr 15 '15 at 23:01
  • Don't style your table with `position: absolute`, it limits the table to the current page. – BrianS Apr 15 '15 at 23:01
  • I figure out about that. My mistake, but finally i decided to use fpdf instead of dompdf, thanks :) – martinezjc Apr 15 '15 at 23:10
  • @martinezjc : :D ROFL . I faced the same issue and thinking about same – Rahul Jan 12 '17 at 11:16

0 Answers0