- Main
- Dashboard
- Page layouts
- Layouts
- Color system
- Starter kit
- Changelog 1.2.1
- RTL version
- Forms
- Form components
- Wizards
- Editors
- Pickers
- Form layouts
- Appearance
- Components
- Content appearance
- Extra components
- Animations
- Icons
- Layout
- Sidebars
- Vertical navigation
- Horizontal navigation
- Navbars
- Menu levels
- Data visualization
- Echarts library
- D3 library
- Dimple library
- C3 library
- Google visualization
- Maps integration
- Extensions
- Extensions
- JQuery UI
- File uploaders
- Event calendars
- Internationalization
- Tables
- Basic tables
- Data tables
- Data tables extensions
- Handsontable
- Responsive options
- Page kits
- Task manager
- Invoicing
- User pages
- Login & registration
- Timelines
- Support
- Search
- Gallery
- Error pages
With DataTables you can alter the ordering characteristics of the table at initialisation time. Using the
order
initialisation parameter, you can set the table to display the data in exactly the order that you want. The order
parameter is an array of arrays where the first value of the inner array is the column to order on, and the second is 'asc'
or 'desc'
as required. The table below is ordered (descending) by the DOB
column.
First Name | Last Name | Job Title | DOB | Status | Actions |
---|---|---|---|---|---|
Sharan | Leland | Aviation Tactical Readiness Officer | 30 Dec 1991 | Inactive | |
Maxwell | Maben | Regional Representative | 25 Feb 1988 | Suspended | |
Maxine | Woldt | Business Services Sales Representative | 17 Oct 1987 | Pending | |
Roland | Salmos | Senior Program Developer | 5 Jun 1986 | Inactive | |
Sylvia | Mcgaughy | Hemodialysis Technician | 11 Nov 1983 | Suspended | |
Coy | Wollard | Customer Service Operator | 12 Oct 1982 | Active | |
Jackelyn | Weible | Airline Transport Pilot | 3 Oct 1981 | Inactive | |
Chantal | Nailor | Technical Services Librarian | 10 Jan 1980 | Inactive | |
Nathalie | Pretty | Drywall Stripper | 13 Dec 1977 | Pending | |
Marth | Enright | Traffic Court Referee | 22 Jun 1972 | Active |
DataTables allows ordering by
multiple columns
at the same time, which can be activated in a number of different ways: - user shift click on a column; - on a per-column basis; - using the columns.orderData
option. The example below shows the first column having a secondary order applied to the second column in the table, vice-versa for the second column being tied directly to the first and the salary column to the first name column.
First Name | Last Name | Job Title | DOB | Status | Actions |
---|---|---|---|---|---|
Aura | Hard | Business Services Sales Representative | 19 Apr 1969 | Suspended | |
Chantal | Nailor | Technical Services Librarian | 10 Jan 1980 | Inactive | |
Cicely | Sigler | Senior Research Officer | 15 Mar 1960 | Pending | |
Coy | Wollard | Customer Service Operator | 12 Oct 1982 | Active | |
Delma | Bonds | Lead Brand Manager | 21 Dec 1968 | Pending | |
Jackelyn | Weible | Airline Transport Pilot | 3 Oct 1981 | Inactive | |
Kennedy | Haley | Senior Marketing Designer | 18 Dec 1960 | Active | |
Lizzee | Goodlow | Technical Services Librarian | 1 Nov 1961 | Suspended | |
Marth | Enright | Traffic Court Referee | 22 Jun 1972 | Active | |
Maxine | Woldt | Business Services Sales Representative | 17 Oct 1987 | Pending |
At times you may wish to change the default ordering direction sequence for columns to be
'descending'
rather than default ascending
. This can be done through the use of the columns.orderSequence
initialisation parameter. The example below shows: Columns 1, 2 - default ordering; Column 3 - ascending ordering only; Column 4 - descending ordering, followed by ascending and then ascending again; Column 5 - descending ordering only.
First Name | Last Name | Job Title | DOB | Status | Actions |
---|---|---|---|---|---|
Aura | Hard | Business Services Sales Representative | 19 Apr 1969 | Suspended | |
Chantal | Nailor | Technical Services Librarian | 10 Jan 1980 | Inactive | |
Cicely | Sigler | Senior Research Officer | 15 Mar 1960 | Pending | |
Coy | Wollard | Customer Service Operator | 12 Oct 1982 | Active | |
Delma | Bonds | Lead Brand Manager | 21 Dec 1968 | Pending | |
Jackelyn | Weible | Airline Transport Pilot | 3 Oct 1981 | Inactive | |
Kennedy | Haley | Senior Marketing Designer | 18 Dec 1960 | Active | |
Lizzee | Goodlow | Technical Services Librarian | 1 Nov 1961 | Suspended | |
Marth | Enright | Traffic Court Referee | 22 Jun 1972 | Active | |
Maxine | Woldt | Business Services Sales Representative | 17 Oct 1987 | Pending |
Complex headers (using colspan / rowspan) can be used to
group
columns of similar information in DataTables, creating a very powerful visual effect. In addition to the basic behaviour, DataTables can also take colspan
and rowspans
into account when working with hidden columns. The example below shows a header spanning multiple cells over the contact information with sorting, with one of the columns that the span covers being hidden.
Name | HR Information | Contact | |||
---|---|---|---|---|---|
Position | Salary | Office | Extn. | ||
Airi Satou | Accountant | $162,700 | Tokyo | 5407 | a.satou@datatables.net |
Ashton Cox | Junior Technical Author | $86,000 | San Francisco | 1562 | a.cox@datatables.net |
Brielle Williamson | Integration Specialist | $372,000 | New York | 4804 | b.williamson@datatables.net |
Cedric Kelly | Senior Javascript Developer | $433,060 | Edinburgh | 6224 | c.kelly@datatables.net |
Charde Marshall | Regional Director | $470,600 | San Francisco | 6741 | c.marshall@datatables.net |
Colleen Hurst | Javascript Developer | $205,500 | San Francisco | 2360 | c.hurst@datatables.net |
Garrett Winters | Accountant | $170,750 | Tokyo | 8422 | g.winters@datatables.net |
Haley Kennedy | Senior Marketing Designer | $313,500 | London | 3597 | h.kennedy@datatables.net |
Herrod Chandler | Sales Assistant | $137,500 | San Francisco | 9608 | h.chandler@datatables.net |
Jena Gaines | Office Manager | $90,560 | London | 3814 | j.gaines@datatables.net |