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

Author - 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.

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

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