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
Satyajit SinghSatyajit Singh 

how to fix a header of apex column

I need that my column header value in a pagebloack table in vf page should be fixed while scrolling and viewing data.
How to do this?

Thanks in Advance!
Shaijan ThomasShaijan Thomas
can you put the code here. I think Output panel will help on this
Shaijan ThomasShaijan Thomas
Can you try the following

<apex:outputPanel id="panelId" style="height:180px;width:100%;overflow:auto;}" layout="block"> Put your code block here

Satyajit SinghSatyajit Singh
Hi Thomas,

I want my my column headers of a page block table to be fixed.. 
for e.g. Contact Name, Email ID, Phone Number..
This code is not working
Satyajit SinghSatyajit Singh
If I'm scrolling a table to view the data, then the column headers like 
Contact Name, Email ID, Phone Number.. should be fixed at their position..
Grazitti TeamGrazitti Team
Hi Shaijan,

You will have to achieve this using jQuery.
Check out the link below:

Hope this will help.

Grazitti Team
Shaijan ThomasShaijan Thomas
I have done this. Can you put the code I can help you
Satyajit SinghSatyajit Singh

Hi Shaijan,
Please find below my code:

<apex:page >
<apex:pageBlock controller = "contactDataController">
        <apex:outputPanel id="panelId" style="height:180px;width:100%;overflow:auto;}" layout="block">
            <apex:pageBlockTable value="{!contactList}" var="item" title="Contact List" id="table123" > 
                <apex:column value="{!item.firstname}"/>
                <apex:column value="{!item.lastname}"/>
                <apex:column value="{!}"/>
                <apex:column value="{!}"/>
</apex:page >

Hi Satyajit/Shaijan,

Are you able to resolve this? I am facing the similar issue to fix the column header of table in vf.
Satyajit SinghSatyajit Singh
Hi, It is not possible in vf Page block table. I’m able to fix the table header using html table and some jQuery resource in vf page. Regards, Satyajit
Hi Satyajit, Thanks for reply. Is that possible for you to share the code (Jquery) or link which you referred . I got few forums and post related to this but not able to fix the issue.
Satyajit SinghSatyajit Singh
Hi PreeSFDCDev,
I forgot the link from where I got the jquery resources. if it is really urgent for you then send me your email Id. I will send you the code and jquery resources which I'm currently using.

Thanks a lot Satyajit. Can you please share the code at