1

I have a table will a large number of datarecords and print it with WKHTMLTOPDF. In the old version of my script (PHP) there was 1 <tr> per datarecord like this:

<tr><td>$row->date $row->username $row->subject <br> $row->multi_line_text </td></tr>

The "line-break"-rules from WKHTMLTOPDF works fine (so when the end of the current cell (<tr><td>) is not on the current page, the cell will begin on the next page.

Now, every datarecord has 2 rows, because the first has now 3 columns:

<tr><td>$row->date</td><td>$row->username</td><td>$row->subject</td></tr> <tr><td colspan=3> $row->multi_line_text </td></tr>

...and now it can happend, that the first line is on page one and the second on page two.

How can I "group" the both <tr> together? A own <table> for every datarecord is no solution, because the 3 columns has to be everytime the same width.

Thank you Olli

Oliver-xx
  • 95
  • 7

1 Answers1

0

Hava e look at How to avoid page break inside table row for wkhtmltopdf and WKHTMLTOPDF - Allow page break in table row

And you write:

A own for every datarecord is no solution, because the 3 columns has to be everytime the same width.

You might want control the width with CSS.

Or go for a div based solution althogether.

Community
  • 1
  • 1
z--
  • 2,186
  • 17
  • 33