+ Start a Discussion
crocodilecrocodile 

Unable to draw borders for a PageBlockTable using frame attribute..

Hi

Am unable draw borders for my page block table. Code:

 

 

<apex:page standardController="Address__c" wizard="true"
    recordSetVar="addrSet" renderAs="html">
    <apex:pageBlock title="PageBlock_001">
        <apex:pageBlockTable value="{!addrSet}" var="a" id="MyTable_001"
            columnsWidth="10px, 10px, 10px" frame="rhs" title="Table_001">
            <apex:column value="{!a.name}"/>
            <apex:column value="{!a.City__c}"/>
            <apex:column value="{!a.Mobile__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>    
</apex:page>
I tried the above code multipletimes by passing frame="none", frame="box", frame="lhs". But the Page Plock table remaiined same in all cases. 
Whats the mistake i done?
Thx,
VNath

 

Pradeep_NavatarPradeep_Navatar

Try using 'border' attribute of <apex:pageBlockTable>. This takes the width of frame around the rendered HTML table, in pixels.

crocodilecrocodile

Thanks Pradeep for the reply.

I tried as suggested. 

 

 

<apex:page standardController="Address__c" wizard="true"
    recordSetVar="addrSet" renderAs="html">
    <apex:pageBlock title="PageBlock_001" lang="en-US">
        <apex:pageBlockTable value="{!addrSet}" var="a" id="MyTable_001"        
            frame="lhs" title="Table_001"
            onclick="XYZ" rendered="true" rows="100" columns="3" rules="all"
            cellpadding="20px"
            summary="Demo of Table viewing.."  first="0" border="10px">
            <apex:column value="{!a.name}" width="50px"/>
            <apex:column value="{!a.City__c}" width="60px"/>
            <apex:column value="{!a.Mobile__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>
But there is no difference in the table view with or without border attribute..
Thx,
VNath

 

AccelciaAccelcia

Use styleClass attribute it applies border only to the table, if u want border for table header use th.

 

 

style {        
        border:0.8px solid black;
}

 

th {
       border:0.8px solid black;
}

 

<apex:pageBlockTable value="{!addrSet}" var="a" id="MyTable_001" styleClass="style " />