Thanks Animasu,
I tried this but it doesn't work. Can you give some sample codes? Thanks again.
Main Topics
Browse All TopicsHi all,
Anyone has some sample codes for implementing an html table with fixed headers (I need to fix 2 rows) and scrollable table body? It needs to work on IE and firefox. I prefer to have html/css or javascript.
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
<div style="margin-top:-6px;mar
If you place this undernieth the <body> tag or before your table it will stretch the screen or container that it is in,it works in IE6 and FF2, if it dosnt work for you let me know and ill see what i can do! all of it is modifiable, apart from position:fixed; this makes the item stay in one place, you can move this around anywhere on the page and have it any width, height, color etc... ive just shown it at the top left of the page streched allover the top!
Hope this help ^_^
- Animasu
Hi Animasu,
I tried it but it didn't work. Here is the code I tried. Can you make any change for it? Thanks.
<html>
<body>
<div style="margin-top:-6px;mar
<table cellspacing="0">
<tr>
<td width="28%">Station</td>
<td width="28%">Date</td>
<td width="28%">Status</td>
<td width="16%">Num.</td>
</tr>
<tr>
<td width="28%">Station 2</td>
<td width="28%">Date 2</td>
<td width="28%">Status 2</td>
<td width="16%">Num. 2</td>
</tr>
</table>
</div>
<div>
<table>
<tr>
<td>KABC</td>
<td>09/12/2002</td>
<td>Submitted</td>
<td>0</td>
</tr>
<tr>
<td>KCBS</td>
<td>09/11/2002</td>
<td>Lockdown</td>
<td>2</td>
</tr>
<tr>
<td>WFLA</td>
<td>09/11/2002</td>
<td>Submitted</td>
<td>1</td>
</tr>
<tr>
<td>WTSP</td>
<td>09/15/2002</td>
<td>In-Progress</td>
<td>10</td>
</tr>
<tr>
<td>WROC</td>
<td>10/11/2002</td>
<td>Submitted</td>
<td>12</td>
</tr>
<tr>
<td>WPPP</td>
<td>09/16/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WRRR</td>
<td>09/06/2002</td>
<td>Submitted</td>
<td>5</td>
</tr>
<tr>
<td>WTTT</td>
<td>09/21/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>W000</td>
<td>11/11/2002</td>
<td>Submitted</td>
<td>7</td>
</tr>
<tr>
<td>KABC</td>
<td>10/01/2002</td>
<td>Submitted</td>
<td>10</td>
</tr>
<tr>
<td>KCBS</td>
<td>10/18/2002</td>
<td>Lockdown</td>
<td>2</td>
</tr>
<tr>
<td>WFLA</td>
<td>10/18/2002</td>
<td>Submitted</td>
<td>1</td>
</tr>
<tr>
<td>WTSP</td>
<td>10/19/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WROC</td>
<td>07/18/2002</td>
<td>Submitted</td>
<td>2</td>
</tr>
<tr>
<td>WPPP</td>
<td>10/28/2002</td>
<td>In-Progress</td>
<td>10</td>
</tr>
<tr>
<td>WRRR</td>
<td>10/28/2002</td>
<td>Submitted</td>
<td>5</td>
</tr>
<tr>
<td>WTTT</td>
<td>10/08/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WIL0</td>
<td>10/18/2001</td>
<td>Submitted</td>
<td>7</td>
</tr>
<tr>
<td>KABC</td>
<td>04/18/2002</td>
<td>Submitted</td>
<td>0</td>
</tr>
<tr>
<td>KCBS</td>
<td>10/05/2001</td>
<td>Lockdown</td>
<td>2</td>
</tr>
<tr>
<td>WFLA</td>
<td>10/18/2002</td>
<td>Submitted</td>
<td>1</td>
</tr>
<tr>
<td>WTSP</td>
<td>10/19/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WROC</td>
<td>12/18/2002</td>
<td>Submitted</td>
<td>2</td>
</tr>
<tr>
<td>WPPP</td>
<td>12/28/2002</td>
<td>In-Progress</td>
<td>8</td>
</tr>
<tr>
<td>WRRR</td>
<td>12/20/2002</td>
<td>Submitted</td>
<td>5</td>
</tr>
<tr>
<td>WTTT</td>
<td>12/11/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>W0VB</td>
<td>01/18/2003</td>
<td>Submitted</td>
<td>17</td>
</tr>
<tr>
<td>KABC</td>
<td>12/17/2002</td>
<td>Submitted</td>
<td>20</td>
</tr>
<tr>
<td>KCBS</td>
<td>12/16/2002</td>
<td>Lockdown</td>
<td>2</td>
</tr>
<tr>
<td>WFAA</td>
<td>12/18/2002</td>
<td>Submitted</td>
<td>1</td>
</tr>
<tr>
<td>WTSP</td>
<td>12/18/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WROC</td>
<td>12/19/2002</td>
<td>Submitted</td>
<td>2</td>
</tr>
<tr>
<td>WPPP</td>
<td>12/06/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WRRR</td>
<td>12/28/2002</td>
<td>Submitted</td>
<td>5</td>
</tr>
<tr>
<td>WTTT</td>
<td>12/30/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>UMBA</td>
<td>12/26/2002</td>
<td>Submitted</td>
<td>7</td>
</tr>
<tr>
<td>KABC</td>
<td>12/18/2002</td>
<td>Submitted</td>
<td>0</td>
</tr>
<tr>
<td>KCBS</td>
<td>12/29/2002</td>
<td>Lockdown</td>
<td>2</td>
</tr>
<tr>
<td>WFFF</td>
<td>12/22/2002</td>
<td>Submitted</td>
<td>1</td>
</tr>
<tr>
<td>WTSP</td>
<td>12/18/2001</td>
<td>In-Progress</td>
<td>9</td>
</tr>
<tr>
<td>WROC</td>
<td>11/19/2001</td>
<td>Submitted</td>
<td>2</td>
</tr>
<tr>
<td>WPPP</td>
<td>11/20/2001</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WRRR</td>
<td>10/19/2001</td>
<td>Submitted</td>
<td>5</td>
</tr>
<tr>
<td>WTTT</td>
<td>11/29/2001</td>
<td>In-Progress</td>
<td>8</td>
</tr>
<tr>
<td>KPLT</td>
<td>11/19/2001</td>
<td>Submitted</td>
<td>7</td>
</tr>
<tr>
<td>KABC</td>
<td>11/19/2001</td>
<td>Submitted</td>
<td>13</td>
</tr>
<tr>
<td>KBRE</td>
<td>11/19/2001</td>
<td>Lockdown</td>
<td>2</td>
</tr>
<tr>
<td>WFLA</td>
<td>11/19/2001</td>
<td>Submitted</td>
<td>1</td>
</tr>
<tr>
<td>WTSP</td>
<td>02/19/2003</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WROC</td>
<td>02/17/2003</td>
<td>Submitted</td>
<td>2</td>
</tr>
<tr>
<td>WPPP</td>
<td>02/16/2003</td>
<td>In-Progress</td>
<td>16</td>
</tr>
<tr>
<td>WRRR</td>
<td>02/29/2003</td>
<td>Submitted</td>
<td>5</td>
</tr>
<tr>
<td>WTTT</td>
<td>03/19/2003</td>
<td>In-Progress</td>
<td>19</td>
</tr>
<tr>
<td>KLTR</td>
<td>02/10/2003</td>
<td>Submitted</td>
<td>7</td>
</tr>
<tr>
<td>KABC</td>
<td>04/05/2003</td>
<td>Submitted</td>
<td>16</td>
</tr>
<tr>
<td>KCBS</td>
<td>02/19/2003</td>
<td>Lockdown</td>
<td>2</td>
</tr>
<tr>
<td>WFLA</td>
<td>02/16/2003</td>
<td>Submitted</td>
<td>1</td>
</tr>
<tr>
<td>WTSP</td>
<td>02/13/2003</td>
<td>In-Progress</td>
<td>5</td>
</tr>
<tr>
<td>WROC</td>
<td>02/14/2003</td>
<td>Submitted</td>
<td>2</td>
</tr>
<tr>
<td>WPPP</td>
<td>03/19/2003</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WRRR</td>
<td>02/19/2002</td>
<td>Submitted</td>
<td>5</td>
</tr>
<tr>
<td>WTTT</td>
<td>02/19/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WYYD</td>
<td>02/11/2002</td>
<td>Submitted</td>
<td>7</td>
</tr>
<tr>
<td>KABC</td>
<td>02/19/2002</td>
<td>Submitted</td>
<td>11</td>
</tr>
<tr>
<td>KCBS</td>
<td>02/19/2002</td>
<td>Lockdown</td>
<td>12</td>
</tr>
<tr>
<td>WFLA</td>
<td>05/19/2002</td>
<td>Submitted</td>
<td>1</td>
</tr>
<tr>
<td>WTSP</td>
<td>02/20/2002</td>
<td>In-Progress</td>
<td>0</td>
</tr>
<tr>
<td>WROC</td>
<td>05/20/2002</td>
<td>Submitted</td>
<td>2</td>
</tr>
<tr>
<td>WPPP</td>
<td>02/19/2003</td>
<td>In-Progress</td>
<td>13</td>
</tr>
<tr>
<td>WRRR</td>
<td>02/19/2002</td>
<td>Submitted</td>
<td>5</td>
</tr>
</table>
</div>
</body>
</html>
<html>
<style>
body{margin:5px;padding:0p
td{width:100px;}
#contain{position:absolute
#fixed{overflow:none;backg
#info{position:relative;ov
</style>
<body>
<div id="contain">
<div id="fixed">
<table cellspacing="0">
<tr>
<td width="28%">Station</td>
<td width="28%">Date</td>
<td width="28%">Status</td>
<td width="16%">Num.</td>
</tr>
<tr>
<td width="28%">Station 2</td>
<td width="28%">Date 2</td>
<td width="28%">Status 2</td>
<td width="16%">Num. 2</td>
</tr>
</table>
</div>
<div id="info">
<table>
<tr>
<td>KABC</td>
<td>09/12/2002</td>
<td>Submitted</td>
...
...
<td>5</td>
</tr>
</table>
</div></div>
</body>
</html>
This is as about fixed as i can get it, it works in resolutions 800x600 - 1280x1024 and IE7 and FF2 i couldnt get the position:fixed to work in IE for some reason... ill have to look into that... anyways this seems to work, i dont know if its what your looking for but please advise!
- Animasu
Business Accounts
Answer for Membership
by: AnimasuPosted on 2006-12-07 at 09:00:29ID: 18094852
You can use a fixed header in CSS with "position:fixed;" this locks it on top and allows all content undernieth to scroll...
Hope this help
- Animasu