On Sep 16, 2:16 am, macsig <sigbac...@gmail.com> wrote:
> Hello guys,
> I'd like to know if there is a way to keep a table header fixed on top
> of a div while I scroll the table rows.
> I have a div high 200px and the table itself is around 300px so when I
> scroll down I'd like to always see the header on top.
> I already use for the table tablesorter so the solution must be
> compatible with that plug-in.
>
> Thanks and have a nice day!
>
> Sig

I think I finally found a way to keep column heads fixed or lined up
with the data columns they go with. Have a look:

  http://sellmycalls.com/fixed-table-header.html

The table id="main" is the body of the table and scrolls vertically
and horizontally.

The div id="header" is fixed vertically but scrolls horizontally.

The only real insight I had was to make the header div be
position:fixed; and to scroll that thing left/right, at intervals of
around 1/10 second, based on the scrollLeft of the window. That keeps
the header line from jumping up and down when scrolling the table
vertically; it jumps left and right when scrolling horizontally, but
that jiggle is less distracting than the old up-and-down motion, imho.

If you use this solution, let us know how you make out.

HTH

-- ben

Reply via email to