How can I set automatic page breaks in TCPDF when a row in a table does not fit on the page?

I made a table in TCPDF using html. Now I need to determine if the table row will fit on the page as their height varies depending on the data they store.

If the line content does not match because it has a large height or line content already reached behind the footer, it will be printed on the next page. How can I achieve this? I am still new to TCPDF.

Thank you for your help!

Example: (In this case, the Employee 3 row does not fit because the Employee 2 row height is high and will be printed on the 2nd page)

Page 1

Employee name || Earnings || Deduction || Net Pay


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 name || Earnings || Deduction || Net Pay


Employee 3

                      - ALLOWANCE   - TAX           30,000.00
                      - LUNCH ALW   - H. PLAN
                                    - LOAN
                                    - LOAN 2
                                    - LOAN 3 
                                    - LOAN 4

      


+3


source to share


1 answer


This might help you: Page break in multi-page TCPDF in multi-core cell problem .

You just need to use the following tag for each element <tr>

.



<tr nobr="true">
  <td>your content here</td>
</tr>

      

+4


source







All Articles