{hero}

column().nodes()

Since: DataTables 1.10

Get the cell nodes for the selected column.

Description

This method is used to get the nodes of for the cells (th / td elements) in the column matched by the selector.

Please note that the order of the nodes in the returned array and which rows the nodes are obtained from (searched rows, visible rows etc) is controlled by the selector-modifier option of the columns() selector used to get the selected columns.

Furthermore, please be aware that using deferRender will cause some nodes to be created only when they are required for display, so they might not be immediately available when this method is called.

Additionally, if the selector used in column() matches more than one column, the result set will be truncated to a single column - the first one in the result set.

Type

function column().nodes()

Description:

Obtain the th / td nodes for the selected column

Returns:

DataTables API instance with each cell's node from the selected columns in the result set. This is a 1D array with each entry being the node for the cells from the selected column.

Example

Add a class to the right most column in the table:

var table = $('#example').DataTable();

table
	.column( -1 )
	.nodes()
	.to$()      // Convert to a jQuery object
	.addClass( 'ready' );
);

Related

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