tables().body()

Since: DataTables 1.10

Get the tbody 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 enable, 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 tbody elements for DOM manipulation.

Type

function tables().body()

Description:

Get the tbody nodes

Returns:

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

Example

Add a class to the original tbody element:

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

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

Related

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