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
pveernapveerna 

examples of coloumclasses in pageblocktable

Taiki YoshikawaTaiki Yoshikawa

Hi,

 

Try this

 

<apex:page Controller="ColumnClassesController">
    <style>
        .col1 {background-color: red;}
        .col2 {background-color: blue;}
    </style>
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable value="{!objAccounts}" var="lists" columnClasses="col1, col2">
                <apex:column >
                    <apex:facet name="header">
                        <apex:outputLabel value="ID" />
                    </apex:facet>
                    <apex:outputField value="{!lists.Id}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:outputLabel value="Name" />
                    </apex:facet>
                    <apex:outputField value="{!lists.Name}"/>
                </apex:column>
            </apex:pageBlockTable> 
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

Regards,