Features

The table controls and information elements that are placed around a DataTable are termed "features", each with its own configuration options. Placement of the features is defined by the layout option, where each slot can contain a feature descriptor.

DataTables has four built in features:

  • info - Summary information about the table
  • pageLength - Page length control
  • paging - Pagination control
  • search - Global search input

New features can be added using the DataTable.feature.register() method and this is extensively used by the official extensions for DataTables.

The following option shows the layout option being used to disable the default pageLength at the top left of the table and to place a paging control at the top right.

new DataTable('#myTable', {
    layout: {
        topStart: null
        topEnd: 'paging'
    }
} );
Library Name Summary
Built in - Info

info

Table information display

Built in - Info

info.callback

Information display callback

Built in - Info

info.empty

Empty table text

Built in - Info

info.postfix

Information string postfix

Built in - Info

info.search

Appended to the info string when searching is active

Built in - Info

info.text

Table summary information display string

Built in - Page Length

pageLength

Paging length control

Built in - Page Length

pageLength.menu

Text for page length control

Built in - Page Length

pageLength.text

Text for page length control

Built in - Paging

paging

Pagination buttons

Built in - Paging

paging.boundaryNumbers

Include (or not) the leading first and last page in the numbers.

Built in - Paging

paging.buttons

Set the maximum number of paging number buttons

Built in - Paging

paging.firstLast

Include (or not) the first and last buttons in the paging control.

Built in - Paging

paging.numbers

Include (or not) the numbers in the paging control.

Built in - Paging

paging.previousNext

Include (or not) the previous and next buttons in the paging control.

Built in - Paging

paging.type

Paging button display options

Built in - Search

search

Global search input

Built in - Search

search.placeholder

Placeholder for the input element

Built in - Search

search.processing

Show processing indicator when searching

Built in - Search

search.text

Text for search control

Built in - Div

div

Text / HTML container

Built in - Div

div.className

Set the class name for the created element.

Built in - Div

div.html

Set the HTML content for the element.

Built in - Div

div.id

Set the ID for the created element.

Built in - Div

div.text

Set the text content for the element.

Buttons

buttons

Table control buttons

Buttons

buttons.buttons

List of buttons to be created

Buttons

buttons.buttons.action

Action to take when the button is activated

Buttons

buttons.buttons.async

Indicate that a button's action processing should be performed asynchronously.

Buttons

buttons.buttons.attr

Collection of attribute key / values to set for a button

Buttons

buttons.buttons.available

Ensure that any requirements have been satisfied before initialising a button

Buttons

buttons.buttons.className

Set the class name for the button

Buttons

buttons.buttons.destroy

Function that is called when the button is destroyed

Buttons

buttons.buttons.dropIcon

Show a dropdown (further action) icon

Buttons

buttons.buttons.enabled

Set a button's initial enabled state

Buttons

buttons.buttons.extend

Define which button type the button should be based on

Buttons

buttons.buttons.init

Initialisation function that can be used to add events specific to this button

Buttons

buttons.buttons.key

Define an activation key for a button

Buttons

buttons.buttons.name

Set a name for each selection

Buttons

buttons.buttons.namespace

Unique namespace for every button

Buttons

buttons.buttons.split

Split dropdown buttons

Buttons

buttons.buttons.tag

Set the tag for the button

Buttons

buttons.buttons.text

The text to show in the button

Buttons

buttons.buttons.titleAttr

Button title attribute text

Buttons

buttons.name

Set a name for the instance for the group selector

SearchBuilder

searchBuilder

Enable and configure the SearchBuilder extension for DataTables

SearchBuilder

searchBuilder.columns

Restrict which columns can be filtered on

SearchBuilder

searchBuilder.conditions

Define custom conditions for SearchBuilder

SearchBuilder

searchBuilder.depthLimit

Impose a limit on the depth of the groups

SearchBuilder

searchBuilder.enterSearch

Trigger a search on the enter key rather than every keypress

SearchBuilder

searchBuilder.filterChanged

Function to update title text when selections are made.

SearchBuilder

searchBuilder.greyscale

Removes the colours from SearchBuilder

SearchBuilder

searchBuilder.liveSearch

Control live search operation

SearchBuilder

searchBuilder.logic

Set the default logic operator

SearchBuilder

searchBuilder.preDefined

Set a predefined search query

SearchPanes

searchPanes

Enable Search Panes

SearchPanes

searchPanes.cascadePanes

Allow panes to cascade under selection

SearchPanes

searchPanes.clear

Disable buttons to allow quick clearing of selections in panes

SearchPanes

searchPanes.collapse

Allow the SearchPanes to be collapsed

SearchPanes

searchPanes.columns

Select which columns should be considered when displaying panes

SearchPanes

searchPanes.controls

Hide the control buttons and disable searching in all panes

SearchPanes

searchPanes.dtOpts

Define properties of the DataTables being used as Panes

SearchPanes

searchPanes.emptyMessage

Deprecated. Set custom empty message

SearchPanes

searchPanes.filterChanged

Function to update title text when selections are made.

SearchPanes

searchPanes.hideCount

Hide the count column in all panes

SearchPanes

searchPanes.i18n

Container for options for language

SearchPanes

searchPanes.i18n.clearMessage

Set the message to be displayed in the Clear button

SearchPanes

searchPanes.i18n.collapse

Set the message to be displayed in the SearchPanes Button

SearchPanes

searchPanes.i18n.collapseMessage

Set the message to be displayed in the Collapse button

SearchPanes

searchPanes.i18n.count

Set the message to be displayed in the count column when not searching

SearchPanes

searchPanes.i18n.countFiltered

Set the message to be displayed in the count column when searching

SearchPanes

searchPanes.i18n.emptyMessage

Add internationalisation to the empty message displayed as a pane option

SearchPanes

searchPanes.i18n.emptyPanes

Add internationalisation to the message shown when no panes are displayed

SearchPanes

searchPanes.i18n.loadMessage

Add internationalisation to the message shown when the panes are loading

SearchPanes

searchPanes.i18n.showMessage

Set the message to be displayed in the Show button

SearchPanes

searchPanes.i18n.title

Add internationalisation to the title showing how many panes are selected

SearchPanes

searchPanes.initCollapsed

Collapse the SearchPanes on initialisation

SearchPanes

searchPanes.layout

Set the layout of how the panes are displayed on the page

SearchPanes

searchPanes.order

Set the order of the Panes

SearchPanes

searchPanes.orderable

Hide the ordering buttons in all panes

SearchPanes

searchPanes.panes

Define custom panes to filter across all columns

SearchPanes

searchPanes.panes.className

Add a custom class for a custom pane

SearchPanes

searchPanes.panes.dtOpts

Define the DataTables options for a custom pane

SearchPanes

searchPanes.panes.header

Define the header for custom panes

SearchPanes

searchPanes.panes.options

Define the options for custom panes

SearchPanes

searchPanes.panes.options.className

Add classes to specific options of a custom pane

SearchPanes

searchPanes.panes.options.label

Define the label for an option of a custom pane

SearchPanes

searchPanes.panes.options.value

Define the value for an option of a custom pane

SearchPanes

searchPanes.panes.preSelect

Deprecated. Define any preSelections for the custom panes

SearchPanes

searchPanes.preSelect

Pre-selected options in a pane

SearchPanes

searchPanes.threshold

Set the minimum ratio of unique values to total values needed in a column to display it's pane

SearchPanes

searchPanes.viewCount

Show the count column in all panes

SearchPanes

searchPanes.viewTotal

Update the count column when searching to show visible count