I 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
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.
-
1But <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