Since: DataTables 1.10

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


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

Consider for example the following HTML header:

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

In this case, when orderCellsTop is false (default) 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.


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




Use the top cells in a complex header for ordering:

$('#example').dataTable( {
  "orderCellsTop": true
} );


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