Skip to content
Keep table header visible when page scrolls. Supports rowspan and colspan. The table header will be fixed once hitting the screen top. Example with twitter bootstrap
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Freeze table header at top of the page when scrolling.

jQuery Plugin for 'freezing' the table header when the page is scrolled and the header would otherwise disappear.

See LIVE example here

For solution to enable independent scrolling of table body only, this is not it. You might want to look at chromatable or other. To be honest, we tried those too, but they didn't handle big tables with colspans and rowspans very well.

Works with multiple header rows and colspan

Using :colspan => 1 and :rowspan => 2 and multiple tr and th works. This was what we needed ourselves.

See example.html.haml


open example.html to check out the behavior.

The html is generated from the HAML using haml example.html.haml > example.html


include the javascript or coffeescript file in your path.

add the css class 'table-fixed-header' to your table. Add the class 'header' to your thead.

      %th header1
      %th header2
      %td val1
      %td val2
      %td val3
      %td val4

Trigger the header freeze with this:



Thanks to for the initial solution Thanks to for the skype share screen sessions and discussions


MIT license

please keep contributing by sharing code :-)

You can’t perform that action at this time.