+ Start a Discussion
SamCousinsSamCousins 

How do I center pageBlock headers?

I can center pageBlockTable headers no problem, but I can't get pageBlock headers to center. 

Can anybody help me with this? Thanks.
Best Answer chosen by SamCousins
Pramodh KumarPramodh Kumar
Here is the small snippet for table header

Let me know if you have any issues.
<style>     
    .table-header{
          text-align:center;
    }
</style>
<apex:pageBlockTable value="{!Accounts}" var="acc" rendered="{!acc.size>0}">
    <apex:column headerClass="table-header" headerValue="Name">
       <apex:inputCheckbox value="{!acc.Name}"/>
    </apex:column >
    <apex:column headerValue="CreatedBy" headerClass="table-header">
             {!acc.CreatedById}
     </apex:column>
     <apex:column headerValue="LastModified" headerClass="table-header">
            {!acc.LastModifiedById}
      </apex:column>
 </apex:pageBlockTable>

Thanks,
pRAMODH.

All Answers

Pramodh KumarPramodh Kumar
Here is the small snippet for table header

Let me know if you have any issues.
<style>     
    .table-header{
          text-align:center;
    }
</style>
<apex:pageBlockTable value="{!Accounts}" var="acc" rendered="{!acc.size>0}">
    <apex:column headerClass="table-header" headerValue="Name">
       <apex:inputCheckbox value="{!acc.Name}"/>
    </apex:column >
    <apex:column headerValue="CreatedBy" headerClass="table-header">
             {!acc.CreatedById}
     </apex:column>
     <apex:column headerValue="LastModified" headerClass="table-header">
            {!acc.LastModifiedById}
      </apex:column>
 </apex:pageBlockTable>

Thanks,
pRAMODH.
This was selected as the best answer
SamCousinsSamCousins
Hi pRAMODH, I can get pageBlockTable headers no problem. It's pageblock headers themselves. Thanks, sam