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
Avinash rao 15Avinash rao 15 

How to manage table breaking after converting vfpage to Pdf

Hi All,

I have created vf page which will be rendered as pdf..
I am getting problem in handling table Rows, How to split table as table moves to next page.
I tried with many stye/css but couldnt solve the issue.. Please help
<apex:page standardController="Client_Invoice__c" extensions="arcinvoicepdf" sidebar="false"  cache="false" readOnly="true" renderAs="pdf" docType="html-5.0">


<apex:form >
<apex:pageBlock >

<apex:dataTable value="{!Client_Invoice__c.Attendance_Record__r}" var="a" border="1" cellpadding="5"  styleClass="table" width="15.92cm" style="text-align:center; line-height: 11pt; font-size:11pt; border-spacing: 0;" columns="3">

      <apex:column >
      
        <apex:facet name="header">Name</apex:facet> 
        <apex:outputText >{!a.Client_Attendance_Record__r.Contact__r.name}</apex:outputText> 
            
      </apex:column>
      
      
      <apex:column >
      
        <apex:facet name="header">Description </apex:facet> 
        <apex:outputText >{!a.Description__c }</apex:outputText>
        
      </apex:column>
      
      <apex:column >
      
        <apex:facet name="header">Cost </apex:facet>
        <apex:outputText >{!a.Cost__c}</apex:outputText>
      </apex:column> 

</apex:dataTable>

</apex:pageBlock>
</apex:form>
</apex:page>

User-added image

from image..once table extends to 2nd page , the last border is breaking..Please help me to manage this table wthout breaking border line..
firechimpfirechimp
The css style page-break-inside: avoid; should work. Or you could just move your table onto the next page by inserting a page break page-break-before: always;
Hope this helps!
Avinash rao 15Avinash rao 15
Thanks for ur relply Firechimp.

I used page-break:avoid but how to use it to handle table break, I mean how to handle table row breaking.

Please can u suggest me with some sample code. May be i am using it in a wrong way..
Ple share some sample code.

Thanks