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

How to freeze header columns in page block table

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

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.

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
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 value="{!a.IsSelected}" styleClass="deleteClass" id="checkedone1" ></apex:inputCheckbox>
        <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>