columns.cellType

Since: DataTables 1.10

Cell type to be created for a column.

Description

Change the cell type created for the column - either TD cells or TH cells.

This can be useful as TH cells have semantic meaning in the table body, allowing them to act as a header for a row (you may wish to add scope='row' to the TH elements using columns.createdCell option).

Type

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

Default

  • Value: td

Example

Have the first column use TH cells`:

$('#example').dataTable( {
  "ajax": "json.txt",
  "columnDefs": [ {
    "targets": 0,
    "cellType": "th"
  } ]
} );

Related

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