columns()

Since: DataTables 1.10

Select multiple columns from a table.

Description

Often you will wish to work with one or more columns in a DataTables - this method provides the ability to select multiple columns from tables, with its chained methods providing the ability to get work with the column, such as getting its data or toggling its visibility.

While column() provides access to a single column, this columns() method is used to allow multiple columns to be manipulated or modified at the same time.

The method has two forms, reflecting the fact the columns can be selected in multiple different ways as your implementation demands:

Types

function columns( [ modifier ] )

Description:

Select all columns

Parameters:
Returns:

DataTables API instance with selected columns in the result set.

function columns( columnSelector [, modifier ] )

Description:

Select columns found by a column selector

Parameters:
Returns:

DataTables API instance with selected columns

Related

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