function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bill clintonBill clinton 

how to change style in pageblocktable column header

User-added image
NagendraNagendra (Salesforce Developers) 
Hi Clinton,

Please try with sample code below.
<apex:page controller="cssQuestion">
 <style>
  .headerRow .TableTitle {
    background-color: #F0F8FF !important;
    background-image: none !important; //This is needed if you want to overwrite the header background
    color: #CC0000 !important; 
    font-size:100% !important; 
  }
 </style>
 <apex:pageBlock>
  <apex:pageBlockSection>
   <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>
  </apex:pageBlockSection>
 </apex:pageBlock>
</apex:page>
Source: http://www.eltoro.it/ArticleViewer?id=a07A000000NPRimIAH

Hope this helps.

Please mark this as solved so that it gets removed from unanswered queue which results in helping others who are encountering similar issue.

Best Regards,
Nagendra.
 
Srirama Murty 6Srirama Murty 6
HeaderClass attribute in apex:column tag does not work in page block table,
unless we use applyhtmltag="false" tag in page like below
<apex:page showHeader="false" sidebar="false" renderAs="PDF" applyBodyTag="false" standardController="Contact"  standardStylesheets="false" applyhtmltag="false">