Scrollable HTML table with fixed headers

I have searched the web for hours looking for an example of how to code a scrollable HTML table that has fixed headers (basically I want to scroll through the table but the headers should always be froze at the top of the table). Has anyone seen an example like this that I could reference? I prefer it not to be based on a Prototype JavaScript framework but Dojo would be acceptable… I guess best case scenario would to have it not be based on any JavaScript framework.

Thanks in advance for your time.

Try google-

Results about 381,000 for scrollable HTML table fixed header javascript.
(0.14 seconds)

This is awesome… thank you very much!!!

For what its worth, I spent most of the day on Google yesterday and was not able to find a workable solution that was not heavily intertwined into a JavaScript framework. I have used Dojo a little but I did not want to use a 2nd framework since I thought it might get confusing having multiple JavaScript frameworks for one web app. Was I wrong to have this opinion?

Is this thing also possible when the scrollbar is larger (height) so it sticks next to the header / footer while the content area just scrolls?

Like in this example:

I think you can make that happen with html and css

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<title>Table Test</title>
table {
	width: 500px;
	height: 500px;

tbody {
overflow: scroll;


<table border="1">
			<th>Another Heading</th>
			<td>row 1, cell 1</td>
			<td>row 1, cell 2</td>
				<td>row 2, cell 1</td>
				<td>row 2, cell 2</td>



Something like that…

Thanks for the effort hannson. It doesn’t work unfortunatelly because the scrollbar will not be next to the header.