fixedHeader.headerOffset

Since: FixedHeader 3.0.0

Offset the table's fixed header. Please note - this property requires the FixedHeader extension for DataTables.

Description

Many web-pages and apps use a navigation element that has fixed positioning applied to it at the top of the page to to provide quick access to common functions and links for an end user. This needs to be accounted for when using FixedHeader so the offset caused by the fixed element doesn't interrupt the correct positioning of the fixed header.

This parameter provides a method that you can use to inform FixedHeader that an offset should be applied, and what that offset should be.

Type

integer

Description:

Set the offset (in pixels) of the header element's offset for the scrolling calculations.

Default

  • Value: 0

Examples

Set the header offset to a known value:

$('#example').DataTable( {
	fixedHeader: {
		headerOffset: 50
	}
} );

Use jQuery to calculate a required offset:

$('#example').DataTable( {
	fixedHeader: {
		headerOffset: $('#navMenu').outerHeight()
	}
} );

Related

The following options are directly related and may also be useful in your application development.