Skip to main content
if page block table has no rows how to display only header columns section.

Thanks.......
2 个回答
  1. 2018年10月22日 13:53
    Hi Krishna,

    You can use apex:column tag simply inside the pageblock like below:

    <apex:pageBlockTable value="{!MyAccounts}" var="Account" >

    <apex:column headerValue="ID" headerClass="TableTitle" value="{!Account.ID}" />

    <apex:column headerValue="Name" headerClass="TableTitle" value="{!Account.Name}" />

    </apex:pageBlockTable>

    or

    you can use the apex:facet inside the apex:colum

    <apex:column > <apex:facet name="header">Name</apex:facet> {!contact.Name} </apex:column>

    <apex:column > <apex:facet name="header">Phone</apex:facet> {!contact.Phone} </apex:column>

    Can you please Let me know if it helps or not!!!

    If it helps don't forget to mark this as a best answer!!!

    Thanks,

    Maharajan.C