HTML Table: Fixed column and row header - column offset using <center>

In a table there are column header and row headers.   The first row displayed in the table should be fixed that is when you scroll the table vertically the top row remains at the top.   The first column also needs to be fixed; that is, when you scroll horizontaly the first column remains at the far left potiion.

Using multiple table solution supplied :

This sample fails to align the column headers correctly (offset by 1/2 the scrollbar width) when I use <center> to center the table (and any other elements i desire to have on the form).
e.g. by encasing the sample in the following form

               <h1>Fixed Headers (resize window to view scrollbars)</h1>
               <table border=0 cellspacing=0 cellpadding=0 width=80% >
............... sample coding of scrollable table

Who is Participating?
gamebitsConnect With a Mentor Commented:
Is this what you are looking for
Jason WatkinsIT Project LeaderCommented:
Why not use a CSS, instead of fixed formatting?

intellias_netAuthor Commented:
The issue was adding fixed by:
<td  align="left">  <--- added alignment
<div class="headerRow">
Also making sure that alignment of the text was consistant from column headers and table body.
intellias_netAuthor Commented:
P.S. Ohter solutions using CSS fo fix headers are convient; however, select elements will not respond to z order and will overlay the fixed headers.  Additionally the calculations of fixed headers using CSS expression has a nast habbit of locking up CPU time in certain situation causing the calculation of offsetWidth/Heights to take extrordinary time.
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.

All Courses

From novice to tech pro — start learning today.