Activity Forums Salesforce® Discussions How to define width of Column in pageBlockTable?

  • Ravi

    Member
    April 26, 2016 at 9:18 am

    Hi Shubham,

    May be you are using pageblocktable inside pageblocksection, I am not sure about it since you have not mention your code here.

    If the pageblocktable is nested in a pageblocksection then the table headers are a fixed size that can't be influenced by the columns. If you make it a child of a pageblock, the widths are honoured.

    <apex:column style="width:200px">

  • Gourav

    Member
    April 26, 2016 at 10:19 am

    You can give width size even when you are using page block table inside page block section. refer given example:-

    <apex:pageBlock title="Contacts">
    <apex:pageblockSection>
    <apex:pageBlockTable value="{!account.Contacts}" columnsWidth="100px, 100px" var="item">
    <apex:column value="{!item.name}"/>
    <apex:column value="{!item.name}"/>
    </apex:pageBlockTable>
    </apex:pageblockSection>
    </apex:pageBlock>

     

    @Ravi

  • Ravi

    Member
    April 26, 2016 at 11:00 am

    When you will use PageBlockTable inside PageBlockSection ,table will be like  this.

    When you will use PageBlockTable inside pageBlock table, table will be like this.
    @Gaurav

    • This reply was modified 8 years, 7 months ago by  Ravi.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos