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
krishna23krishna23 

How to freeze header columns in page block table

While scrolling records how to freeze header columns in page block table

Thanks......
Khan AnasKhan Anas (Salesforce Developers) 
Hi Krishna,

Greetings to you!

You can use jQuery to achieve this. Please refer to the below links which might help you with the above issue.

http://apexfixheader.blogspot.com/

https://salesforce.stackexchange.com/questions/1892/how-do-i-support-scrolling-and-lock-freeze-the-header-row-of-a-pageblocktable

https://developer.salesforce.com/forums/?id=906F0000000BUM3IAO

https://jeromebulanadi.wordpress.com/2010/03/22/scrollable-fixed-header-table-a-jquery-plugin/


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks and Regards,
Khan Anas
krishna23krishna23
Hi Khan,

I have tried all blogs but I am not able to freeze the header for below table
<apex:pageBlock id="PbId" >                        
<div style="overflow: scroll; height: 250px;">
    <apex:outputText value="Selected List (Total List: {!wrapList.size} )" />
    <apex:pageBlockTable value="{!wrapList}" var="a" id="recordsTable"> 
        <apex:column >
            <apex:facet name="header"> <apex:inputCheckbox >
                <apex:actionSupport event="onclick" action="{!Selected}" onsubmit="checkAllSelected(this)" rerender="PBS"   status="status"/>
                </apex:inputCheckbox>
            </apex:facet>
            <apex:inputCheckbox value="{!a.IsSelected}" styleClass="deleteClass" id="checkedone1" ></apex:inputCheckbox>
        </apex:column>
        <apex:column headerValue="Name">{!a.Li.Name}</apex:column>
        <apex:column headerValue="Number">{!a.Li.Number__c}</apex:column>
        <apex:column headerValue="Number">{!a.Li.Number__c}</apex:column>
    </apex:pageBlockTable>