tables().containers()

Since: DataTables 1.10.1

Get the div container nodes for the tables in the API's context.

Description

DataTables places the main table and all of the various component display controls for the table inside a container element, a div element with a class of dataTables_wrapper (by default).

This method provides the ability to obtain that node for all tables in the API instance's context, which can be used by plug-in authors to add additional controls to the table.

Type

function tables().containers()

Description:

Get the div container nodes

Returns:

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

Example

Add a class to the container nodes:

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

tables
	.tables()
	.containers()
	.to$()
	.addClass( 'selectable' );

Related

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