#Sticky Table jQuery Plugin
Make header and a left column stick when scroll large tables.
This basic usage will make the headers of the table stick.
$('table').sticky();
This will attach an event handler to the window.scroll
to detach that call
$('table').sticky('unstick');
To get sticky columns must specify how many columns to stick, the following example will stick the first 2 columns
$('table').sticky( {columnCount: 2} );
The sticky plugin supports the following options
Name | Default | Description |
---|---|---|
offset | { top: 0, left: 0 } | Offset of fixed top and fixed left position. Specify these to change where the fixed header and column will start.
|
The table cells must have a fixed width and height. That can be specified with the
cellWidth
and cellHeight
options.
The table cannot change position, e.g. get more margin after .sticky
function has been applied.