{hero}

table().header()

Since: DataTables 1.10

Get the thead node for the table in the API's context.

Description

DataTables and its plug-ins can create additional tables in the document. For example when scrolling is enabled, the table is split into three individual tables, the header, footer and body in order to provide cross-browser scrolling, while FixedHeader / FixedColumns create cloned tables for static positioning.

This method, and its plural counterpart, are provided to give easy access to the original thead element for DOM manipulation.

Type

function table().header()

Description:

Get the thead node

Returns:

HTML thead node.

Example

Add a class to the original thead element:

var table = new DataTable('#myTable', {
	scrollX: '100%'
});

$(table.table().header()).addClass('highlight');

Related

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