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 dt-container (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
tables().containers()
Get the div container nodes
Returns:
DataTable.Api: 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 = new 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.