Since: DataTables 1.10

Get the data for the cells in the selected columns.


This method is used to get the data used for the cells in the columns matched by the selector from DataTables.

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


function columns().data()


Obtain the data for the columns from the selector


DataTables API instance with data for each cell in the selected columns in the result set. This is a 2D array with the top level array entries for each column matched by the columns() selector.


Get a list of the unique data, sorted, from a single column:

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

		.eq(0) // Reduce the 2D array into a 1D array of data
		.sort() // Sort data alphabetically
		.unique() // Reduce to unique values

Check if a value is in the data in the columns with a class of '.check':

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

var idx = table
	.eq(0) // Reduce the 2D array into a 1D array of data

if (idx === -1) {
	alert('Yes not found');
else {
	alert('Yes was found');


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