Sunday, January 20, 2008

How to freeze/lock the table header

We often face reqirement where header should be locked and should not scroll when the data is scrolling. For that purpose we use the following style attribute in the tr section to get the heading part locked

<tr style="position:relative;top: expression(this.offsetParent.scrollTop-2);" valign="top">

1 Comments:

Blogger Unknown said...

I tried as your sample, but it did not work in my case, the header still scrollable, do you know why? And how to solve this?

8:35 AM  

Post a Comment

<< Home