Since: DataTables 1.10

Get the header node for the selected column.


This method can be used to obtain (and therefore modify) the header cell used for a column. This may be a th or td element depending on the HTML for your table.

The cell return is the one used by DataTables for adding the ordering click listener. If you have multiple cells in a header (i.e. multiple rows), which one DataTables uses as the primary header cell is defined by the orderCellsTop option.

Note that if the selector used in column() matches more than one column, the result set will be truncated to a single column - the first one in the result set.


function column().header( [row] )


Get the header th / td cell for a column.


The header cell for the selected column.


Alert the name of the column for a cell that was clicked on:

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

$('#example tbody').on('click', 'td', function () {
	var idx = table.cell(this).index().column;
	var title = table.column(idx).header();

	alert('Column title clicked on: ' + $(title).html());


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