table().body()

Since: DataTables 1.10

Get the tbody 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 enable, the table is split into three individual tables, the footer, 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 tbody element for DOM manipulation.

Type

function table().body()

Description:

Get the tbody node

Returns:

HTML tbody node.

Example

Add a class to the original tbody element:

var table = $('#example').DataTable( {
	scrollX: "100%"
} );

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

Related

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