{hero}

columns().types()

Since: DataTables 2.0

Get the data types for selected columns.

Description

This method is used to get the data types for selected columns. This is basically the same as the singular column().type() method, but in this case can be used to get the data type for multiple columns at the same time.

Please refer to the column().type() documentation for discussion on column data types.

Type

function columns().types()

Description:

Get the configured or automatically detected data type for selected columns.

Returns:

API instance whose data set is the data types for the selected columns (will be strings).

Example

Log the detected data types for all columns:

let table = new DataTable('#example');

console.log(
	table
		.columns()
		.types()
		.toArray()
);

Related

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