{hero}

tables().header()

Since: DataTables 1.10

Get the thead nodes for the tables 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 singular counterpart, are provided to give easy access to the original thead elements for DOM manipulation.

Type

function tables().header()

Description:

Get the thead nodes

Returns:

DataTables API instance with the table header nodes from the selected tables in the result set.

Example

Add a class to the original thead element:

var tables = new DataTable('.dataTable', {
	scrollX: '100%'
});

tables
	.tables()
	.header()
	.to$()
	.addClass('highlight');

Related

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