function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
joemurjoemur 

How do I add pagebreak to every other record in apex:repeat?

I want to include only two repeat tables per page when rendered in WORD.  I need a way to count how many records have been processed so I can add <br clear="all" style="page-break-before:always" /> after every other record.  I believe I need to set a global field as a counter and check the modulus but just don't know how to do that within a visualforce page.
NagendraNagendra (Salesforce Developers) 
Hi Joemur,

May I suggest you please give a try with the below code
 
​page-break-after: always;
CSS to break the page
</apex:repeat> </apex:pageBlock> 
<p style="page-break-after: always;" >
</p> </apex:repeat>
Please let us know if this helps.

Regards,
Nagendra.