Page break in PDF not working when table is created in loop

|
| By Webner

Problem: Page break in PDF was not working when table was created in loop. We wanted to have certain amount of rows on same page. If there was not enough space then next set of rows automatically shifted to the next page.

Solution: We can not use the page break in ‘tr” or “td” while we are generating the table in a loop from dynamic data. Thus to solve this problem we used the empty row concept. We inserted the empty row after certain rows that fit in a single page. This moved the set of rows which were needed to be on the same page and next set of rows on next page.

Note: Change the CSS of row and make it look transparent.

Leave a Reply

Your email address will not be published. Required fields are marked *