I need to add a page breaking inside Nested Table in MPDF is it possible?.
This is working with single table page break(multiple pages).
<?php
$html='<table border="1" width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="20" align="center"><strong>No</strong></td>
<td style="min-width:300px" align="center"><strong>Name</strong></td>
<td width="100" align="center"><strong>Qty</strong></td>
<td width="100" align="center"><strong>Unit Price</strong></td>
</tr>';
for($i=1;$i<=70;$i++){
$html.=' <tr>
<td align="center" ><strong>'.$i.'.</strong></td>
<td align="left"><strong>CAR MAINTENANCE</strong><br></td>
<td align="center">12.00</td>
<td align="center">1,000.00</td>
</tr>';
}
$html .=' </tbody></table>';
include("mpdf60/mpdf.php");
$mpdf=new mPDF();
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
$html1=mb_convert_encoding($html, 'UTF-8', 'UTF-8');
$mpdf->WriteHTML($html1);
$mpdf->Output();
exit;
While, This is not working while using a Nested Table
<?php
$html='<table border="1" width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<table border="1" width="100%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="20" align="center"><strong>No</strong></td>
<td style="min-width:300px" align="center"><strong>Name</strong></td>
<td width="100" align="center"><strong>Qty</strong></td>
<td width="100" align="center"><strong>Unit Price</strong></td>
</tr>';
for($i=1;$i<=70;$i++){
$html.=' <tr>
<td align="center" ><strong>'.$i.'.</strong></td>
<td align="left"><strong>CAR MAINTENANCE</strong><br></td>
<td align="center">12.00</td>
<td align="center">1,000.00</td>
</tr>';
}
$html .=' </tbody></table>
</td></tr>
</tbody></table>';
include("mpdf60/mpdf.php");
$mpdf=new mPDF();
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
$html1=mb_convert_encoding($html, 'UTF-8', 'UTF-8');
$mpdf->WriteHTML($html1);
$mpdf->Output();
exit;
I need a page breaking inside Main table td to break page(if large nested table data) and in nested table tr page break( while,single table working perfect!) also