DataTables logo DataTables

This site contains the legacy documentation for DataTables v1.9 and earlier for reference only.
DataTables 1.9 was End Of Life in 2014. Do not use it for new work.
The current release of DataTables can always be found on DataTables.net.

Custom classes

In order to provide complete styling flexibility, DataTables provides methods to customise the classes which are used for the various elements created by DataTables. These are fully detailed below, indicating what the various uses for, but it can be just as instructive to have a peak at the live DOM of an example table using Firebug, Webkit's Inspector, IE's developer tools, or any of the other options.

Two different sets of default classes are provided in DataTables, and which one is used is selected by the initialisation parameter:

Features

sWrapper
Show details
Applied to the DIV element that DataTables wraps around all elements it creates (including the table itself)
sFilter
Show details
Applied to the DIV element created for the filtering input
sInfo
Show details
Applied to the DIV element created for the current display information
sPaging
Show details
Applied to the DIV element created for the paging controls. Note that the name of the paging method used is postfixed to this class
sLength
Show details
Applied to the DIV element created for the display length changing control
sProcessing
Show details
Applied to the DIV element created for the processing display

Two button pagination

sPagePrevEnabled
Show details
Previous paging button enabled
sPagePrevDisabled
Show details
Previous paging button disabled
sPageNextEnabled
Show details
Next paging button enabled
sPageNextDisabled
Show details
Next paging button disabled
sPageJUINext
Show details
Icon to use for the "next" button. Used for jQuery UI themes only.
sPageJUIPrev
Show details
Icon to use for the "previous" button. Used for jQuery UI themes only.

Full numbers pagination

sPageButton
Show details
Generic class to give to the paging buttons
sPageButtonActive
Show details
Class to give the number in the list which represents the current page
sPageButtonStaticDisabled
Show details
Class to apply to the static buttons ('Next', 'Previous' etc) which would have no effect on the current page.
sPageFirst
Show details
Class to apply to the 'First' button
sPagePrevious
Show details
Class to apply to the 'Previous' button
sPageNext
Show details
Class to apply to the 'Next' button
sPageLast
Show details
Class to apply to the 'Last' button

Striping

sStripeOdd
Show details
Default for odd rows
sStripeEven
Show details
Default for even rows

Empty rows

sRowEmpty
Show details
Applied to the TR element that DataTables will create to show 'No matching records' information

Sorting

sSortAsc
Show details
Applied to the TH element which has sorting ascending applied to it. Note that when the jQuery UI theming option is enabled, an extra element (span) is added into the TH for icon display
sSortDesc
Show details
Applied to the TH element which has sorting descending applied to it.
sSortable
Show details
Applied to TH elements which are sortable (if they don't already have sorting asc or desc applied)
sSortColumn
Show details
Class applied to TD elements in column which is currently being sorted. Note that this class will have the number '1', '2' or '3' postfixed to it to indicate the priority of the sorting (multi-column sorting)
sSortJUIAsc
Show details
Icon class for sorting ascending
sSortJUIDesc
Show details
Icon class for sorting descending
sSortJUI
Show details
Icon class for a sortable column which does not have sorting acs or desc applied
sSortableAsc
Show details
This class is applied to column headers which have sorting enabled, but only allow sorting in the ascending direction.
sSortableDesc
Show details
This class is applied to column headers which have sorting enabled, but only allow sorting in the descending direction.
sSortJUIAscAllowed
Show details
This class is applied to the icon element in column headers which have sorting enabled, and jQuery UI theming is enabled, but only allow sorting in the ascending direction.
sSortJUIDescAllowed
Show details
This class is applied to the icon element in column headers which have sorting enabled, and jQuery UI theming is enabled, but only allow sorting in the descending direction.
sSortableNone
Show details
Applied to TH elements which have sorting disabled on them (i.e. bSortable:false).