{hero}

column().select()

Since: Select 1.0.0

Select a single column.
Please note - this property requires the Select extension for DataTables.

Description

This method simply selects a single column that has been found by the column() selector method.

If the selection style (select.style / select.style()) is set to single any previously selected columns will be automatically deselected. Otherwise the column will be added to the current selected set.

Selected columns can later be retrieved using the selected extension to the selector-modifier object - for example table.columns( { selected: true } ).data() will get the data of all columns which are selected in the table.

Type

function column().select()

Description:

Select a single column in the table, based on the column found by the column() method.

Returns:

API instance that contains a reference to the selected column.

Example

Select the last column in the table (i.e. the right most column):

var table = new DataTable('#myTable');

table.column(-1).select();

Related

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