Since: DataTables 1.10

Get index information about the selected cells.


DataTables stores the data for rows and columns in internal indexes which it can utilise for fast operation of ordering, searching etc. It can be useful at times to know what these indexes are, as they can be used for efficient selectors in the rows(), columns() and other API methods which use selectors.

Usefully, this method also provides the visible column index as well as the column data index, as columns can be added and removed from the document dynamically.

The data structure returned for each cell in the result set from the cells() selection method is:

    "row":           integer, // Row index
    "column":        integer, // Column data index
    "columnVisible": integer  // Column visible index


function cells().indexes()


Get row, column and visible column index information


DataTables API instance with cell index information in the result set


Get column indexes for every cell which contains the value '21':

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

var columns = table

alert('Columns containing 21: ' + columns.join(', '));


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