I made a table in TCPDF using html. Now, I need to determine if a table row will fit in the page since their height varies depending on the data they hold.
If the row's content won't fit because it has a big height or the row's content already reached past the footer, it will be instead printed to the next page. How can I achieve this? I'm still new to TCPDF.
Thanks for your help!
Example: (in this case, Employee 3 row doesn't fit because Employee 2 row's height is high and will be printed at the 2nd page)
Page 1
Employee 1
- ALLOWANCE - TAX 20,000.00
- N.SHIFT - H. PLAN
- LUNCH ALW - LOAN
- LOAN 2
- LOAN 3
Employee 2
- ALLOWANCE - TAX 18,000.00
- N.SHIFT - H. PLAN
- LUNCH ALW - LOAN
- LOAN 2
- LOAN 3
- LOAN 4
- LOAN 5
- LOAN 6
- LOAN 7
Page 2
Employee 3
- ALLOWANCE - TAX 30,000.00
- LUNCH ALW - H. PLAN
- LOAN
- LOAN 2
- LOAN 3
- LOAN 4
This might help you: TCPDF multipage table page break in multiline cell problem.
You just have to use following tag on each <tr>
element.
<tr nobr="true">
<td>your content here</td>
</tr>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With