Options

The options that FixedHeader presents are basically feature enablement option (which sides of the table should be fixed. Fine tuning of the frozen row / column options is also possible through the zIndex options.

Initialisation

Initialisation of FixedHeader is done by creating a new instance of the $.fn.dataTable.FixedHeader class. The constructor for this class takes two parameters: the first is the DataTables instance to attach the fixed header to, and the second (which is optional) is an object with the FixedHeader options you wish to apply. For example:

$(document).ready( function () {
    var table = $('#example').dataTable( {
        "paginate": false
    } );
    new $.fn.dataTable.FixedHeader( table );
} );

Options

bottom
Show details
Fix the table footer in place, or not, as required.
Default: false
Type: Boolean
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, { "bottom": true } );
} );
left
Show details
Fix the left most column in place, or not, as required.
Default: false
Type: Boolean
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, { "left": true } );
} );
offsetTop
Show details
Specify an offset from the top of the window where the fixed header where be locked to when scrolling. This is useful for working with fixed elements at the top of the page - for example the Twitter Bootstrap fixed menu.
Default: 0
Type: Integer
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, {
        "offsetTop": 40
    } );
} );
right
Show details
Fix the right most column in place, or not, as required.
Default: false
Type: Boolean
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, { "right": true } );
} );
top
Show details
Fix the table header in place, or not, as required.
Default: true
Type: Boolean
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, { "top": false } );
} );
zBottom
Show details
Set the z-index for the floating footer
Default: 103
Type: Integer
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, {
        "bottom": true,
        "zBottom": "2001"
    } );
} );
zLeft
Show details
Set the z-index for the floating left column
Default: 102
Type: Integer
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, {
        "left": true,
        "zLeft": "2001"
    } );
} );
zRight
Show details
Set the z-index for the floating right column.
Default: 101
Type: Integer
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, {
        "right": true,
        "zRight": "2001"
    } );
} );
zTop
Show details
Set the z-index for the floating header
Default: 104
Type: Integer
Code example:
$(document).ready( function () {
    var oTable = $('#example').dataTable();
    new FixedHeader( oTable, { "zTop": "2001" } );
} );