Since: DataTables 1.10

Control which cell the order event handler will be applied to in a column.


As of v2.0.0 this feature has been deprecated. This feature has not yet been scheduled for removal, but its use is discouraged and the alternatives discussed below should be used.


Allows control over whether DataTables should use the top (true) unique cell that is found for a single column, or the bottom (false) to attach the default order listener and display sorting icons. This can be useful when using complex headers.

As of DataTables 2, if the value of this parameter is given as null (which it is by default) all cells in the header will automatically have the sort listener attached and icons shown.

Consider for example the following HTML header:

            <td rowspan="2">1</td>

In this case, when orderCellsTop is false the cells 1 and 2.2 will have the order event listener applied to them. If orderCellsTop is true then 1 and 2.1 will have the order event listeners applied to them. Finally, if the value is given is null (default), all cells will have the ordering event listeners attached.


This option can be given in the following type(s):




Use the top cells in a complex header for ordering:

new DataTable('#myTable', {
	orderCellsTop: true


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