I want to switch from TCPDF to mPDF. In my document, I’m using a two column layout which itself contains subtables that might have different height, so it looks like a fluid layout. With TCPDF it looks like:
The basic syntax for this layout is:
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width: 50%;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width: 40%;">Label ABC</td>
<td>Value XYZ</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width: 40%;">Label ABC</td>
<td>Value XYZ</td>
</tr>
</table>
[...]
</td>
<td style="width: 50%;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width: 40%;">Label ABC</td>
<td>Value XYZ</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width: 40%;">Label ABC</td>
<td>Value XYZ</td>
</tr>
</table>
[...]
</td>
</tr>
</table>
Using mPDF, it tries to shrink the table, which is nothing I want. So I’ve disabled shrink with $pdf->shrink_tables_to_fit = 1;
.
Can I achieve a similar behavior in mPDF, so that table rows that contain long texts are auto break onto new page?
EDIT: Just to clarify, I want the only outer <tr>
to break within content. The two columns of outer table contain many slim nested tables (see code and image above). Due to fluid layout, I’ve nested the tables in one outer <tr>
containing two columns.
4