select.className

Since: Select 1.1.0

Set the class name that will be applied to selected items. Please note - this property requires the Select extension for DataTables.

Description

Which items are selected in a table, Select will add a class to the item so it can be appropriately highlighted by CSS to show the end user that the item has been selected

The Select and DataTables style sheets have appropriate classes to perform this action, however it can often be useful to be able to specify your own class to perform your own custom highlighting. This option provides that ability.

Type

string

Description:

The class name that will be applied to the items selected in the DataTable. This can be multiple classes, separated by a space if required.

Default

  • Value: selected

Example

Set a custom class name for the item selection class:

$('#example').DataTable( {
	select: 
		style:     'os',
		className: 'row-selected'
	}
} );