2

I'm not able to show just a solid border around visualforce data tables rendered on a pdf using the following visualforce tag and CSS. table shows as a framed style.

enter image description here

<apex:pageBlockSection columns="1" id="section2c" title="Expiring Contract Experience" showHeader="true" rendered="{!NOT(PriorYRcontractSectionList.size == 0)}" > 
         <apex:outputPanel id="out2c">
            <apex:actionstatus startText="loading...">
                <apex:facet name="stop" >
                    <apex:outputPanel >

                         <apex:dataTable id="dt2c" styleClass="allPDFdatatables" headerClass="allPDFdatacols" columnClasses="allPDFdatacols" rowClasses="allPDFdatarows" value="{!PriorYRcontractSectionList}" var="pyr" rules="all" cellpadding="5"  >
                            <apex:column value="{!pyr.Name}" headerValue="Contracts"/>
                            <apex:column value="{!pyr.ULTIMATE_PREMIUM__c}" headerValue="Ult Prem"/>                                                       
                            <apex:column value="{!pyr.PAID_LOSS__c}" headerValue="Ttl Rprd Loss" rendered="{! (allNulls_PAID_LOSS_dt2c || hidecols) }"/>  
                             <apex:column value="{!pyr.ACR__c}" headerValue="Ttl ACR"  rendered="{! (allNulls_ACR_dt2c || hidecols) }" />  
                            <apex:column value="{!pyr.ULTIMATE_LOSS__c}" headerValue="Ttl Ult Loss Incl ACR" rendered="{! (allNulls_ULTIMATE_LOSS_dt2c || hidecols) }" />                               
                            <apex:column value="{!pyr.Ultimate_Loss_Ratio__c}" headerValue="Ult LR%" rendered="{! (allNulls_Ultimate_Loss_Ratio_dt2c || hidecols) }" />  
                            <apex:column value="{!pyr.F_DETAIL_COMMISSION__c}" headerValue="Ult Comm%" rendered="{! (allNulls_F_DETAIL_COMMISSION_dt2c || hidecols) }" />  
                            <apex:column value="{!pyr.F_DETAIL_BROKERAGE__c}" headerValue="Ult Brok%" rendered="{! (allNulls_F_DETAIL_BROKERAGE_dt2c || hidecols) }" />     
                            <apex:column value="{!pyr.ULT_OVERHEAD_EXCL_CATS__c}" headerValue="Ult OH%" rendered="{! (allNulls_ULT_OVERHEAD_EXCL_CATS_dt2c || hidecols) }" />
                            <apex:column value="{!pyr.ULT_CR_ACCT_OH__c}" headerValue="Ult CR%" rendered="{! (allNulls_ULT_CR_ACCT_OH_dt2c || hidecols) }" /> 
                            <apex:column value="{!pyr.ULT_CR_ACCT_EXCL_OH__c}" headerValue="Ult CR x OH%" rendered="{! (allNulls_ULT_CR_ACCT_EXCL_OH_dt2c || hidecols) }" />                               
                            <apex:column value="{!pyr.ITD_CR_EXCL_ACCT_OH__c}" headerValue="ITD CR x OH%" rendered="{! (allNulls_ITD_CR_EXCL_ACCT_OH_dt2c || hidecols) }" />                                                                
                        </apex:dataTable>

                   </apex:outputPanel>
                </apex:facet>
            </apex:actionstatus>
        </apex:outputPanel>

.allPDFdatatables {
text-align: right;
font-family: 'Arial'; 
font-size: 75%;   
vertical-align: middle;
border-collapse: collapse; 
border: 1px solid black;
padding: 5px 5px 5px 5px;
color: blue;
-fs-table-paginate: paginate;
border-spacing: 0;
cellspacing 0;}

.allPDFdatarows {
text-align: right;
font-family: 'Arial'; 
font-size: 75%;   
vertical-align: middle;
border-collapse: collapse; 
border: 1px solid black;
padding: 5px 5px 5px 5px;
color: black;    
cellspacing 0;}

.allPDFdatacols {
border-collapse: collapse; 
border: 1px solid black;
cellspacing 0;   }

@page {size: ledger landscape;
@bottom-right { content: "Page " counter(page) "of " counter(pages);}
margin-top:3cm; margin-left:2.54cm; margin-right:2.54cm; margin-bottom:3cm; margin-top:1cm;  margin-left:1cm; margin-right:1cm; margin-bottom:1cm; }
2
  • Looks like padding issue across table, try removing cellpadding="5" in datatable as well as padding: 5px 5px 5px 5px; in allPDFdatatables class style. Also remove any spacing. Commented Feb 7, 2017 at 17:23
  • Excellent. Shut down the cell padding. Tables looking much better now. Thanks. Commented Feb 10, 2017 at 3:10

1 Answer 1

2

Table has some default borders and you have following padding or spacing in your code:

  • try removing cellpadding="5" in datatable as well as padding: 5px 5px 5px 5px; in allPDFdatatables class style. Also remove any spacing
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.