titleRow
Since: DataTables 2.3
Control which row in the header is the title row.
Description
This option can be used to control how DataTables which cells in a table header are treated as a "title cell".
Title cells are used for the following in DataTables:
- Indicate the ordering status of its column(s) (`-init ordering.indicators)
- Have a click / return key listener on them to activate ordering (
ordering.handler
) - Column titles (
columns.title
andcolumn().title()
).
You can give this option as one of several values:
- A
number
- this will specify the row index in the header that is used for the above. true
- the cells in the top row (index 0) will be used for the title cellsfalse
- the cells in the bottom row will be used for the title cellsnull
(default) - all cells will be used for ordering operations, and the first unique cell (i.e. colspan=1) will be used for the column title.
Type
This option can be given in the following type(s):
Default
null
Examples
Use the first row in the header as the title row:
new DataTable('#myTable', {
titleRow: 0
});
Use the second row in the header as the title row:
new DataTable('#myTable', {
titleRow: 1
});
Related
The following options are directly related and may also be useful in your application development.