Lock Header for HTML Table


I have a report which is displayed as a html table.

What i wanted was that the table header i.e .the first row should be locked i.e. fixed.

The scrolling should be on the subsequent rows only so that the user can always see the table header.

I thought of frames initially,keeping the header in a separate frame.

But if i use that,taking a printout of the report would be cumbersome,as the print would be of the current frame only and that wouldnt contain the header.

Pls Help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There's no inherent way to do this using CSS attributes or anything for different table elements, but have a look at the JavaScript in this link:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
You might also want to consider exporting your report into Excel.  It's very easy using ASP.  But of course it all depends on your enviornment and what's best for your users.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.