1

enter image description hereI am creating and pdf page which is having a Page block table. I am having about 40 + items to display on it. My table is getting break in between. I want to display it on another page with with same header. Is their any attribute that i can use?

1 Answer 1

1

Indeed there is a specific style attribute that creates page breaks at desired locations on the page.

<div style="page-break-before: always" />

Will move everything that appears after this DIV onto the next page.

There are also other similar page-break properties, you can see how they all work here.

Also note that pageblock table is not recommended to be used in a PDF, you better off replacing that with a normal HTML table using apex:repeat's. There is more information on what Visualforce elements are safe to use in a PDF here.

2
  • 1
    But <div style="page-break-before: always" /> will move all the content to next page which generates an unnecessary space. Commented Apr 30, 2015 at 9:59
  • Check out here how to add header/footer on all your pages - help.salesforce.com/apex/… Commented Apr 30, 2015 at 23:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .