-
Main
- Dashboard No active orders
- Layouts
- Themes
- Starter kit
- Changelog2.0
- RTL version
-
Forms
- Form components
- JSON forms
- Text editors
- Pickers
- Form layouts
-
Components
- Basic components
- Content styling
- Extra components
- Color system
- Animations
- Icons
-
Layout
- Page layouts
- Sidebars
- Navbars
- Vertical navigation
- Horizontal navigation
- Menu levels
-
Data visualization
- Echarts library
- D3 library
- Dimple library
- C3 library
- Google charts
- Maps integration
-
Extensions
- Extensions
- JQuery UI
- File uploaders
- Event calendars
- Internationalization
-
Tables
- Basic tables
- Data tables
- Data tables extensions
- Handsontable
- Responsive tables
-
Page kits
- General pages
- Service pages
- User pages
- Application pages
- Widgets
Basic example of a datatable with
HTML (DOM)
sourced data. The foundation for DataTables is progressive enhancement, so it is very adept at reading table information directly from the DOM
. This example shows how easy it is to add searching, ordering and paging to your HTML table by simply running DataTables with basic configuration on it.
Name | Position | Age | Start date | Salary | Actions |
---|---|---|---|---|---|
Airi Satou | Accountant | 33 | 2008/11/28 | $162,700 | |
Ashton Cox | Junior Technical Author | 66 | 2009/01/12 | $86,000 | |
Brielle Williamson | Integration Specialist | 61 | 2012/12/02 | $372,000 | |
Cedric Kelly | Senior Javascript Developer | 22 | 2012/03/29 | $433,060 | |
Charde Marshall | Regional Director | 36 | 2008/10/16 | $470,600 | |
Colleen Hurst | Javascript Developer | 39 | 2009/09/15 | $405,500 | |
Garrett Winters | Accountant | 63 | 2011/07/25 | $170,750 | |
Haley Kennedy | Senior Marketing Designer | 43 | 2012/12/18 | $113,500 | |
Herrod Chandler | Sales Assistant | 59 | 2012/08/06 | $137,500 | |
Jena Gaines | Office Manager | 30 | 2008/12/19 | $90,560 |
At times you will wish to be able to create a table from dynamic information passed directly to DataTables, rather than having it read from the document. This is achieved using the
data
option in the initialisation object, passing in an array
of data to be used. This examples shows the element being added by Javascript and then initialising the DataTable with a set of data from a Javascript array
.
Engine | Browser | Platform | Version | Grade |
---|---|---|---|---|
Gecko | Firefox 1.0 | Win 98+ / OSX.2+ | 1.7 | A |
Gecko | Firefox 1.5 | Win 98+ / OSX.2+ | 1.8 | A |
Gecko | Firefox 2.0 | Win 98+ / OSX.2+ | 1.8 | A |
Gecko | Firefox 3.0 | Win 2k+ / OSX.3+ | 1.9 | A |
Gecko | Camino 1.0 | OSX.2+ | 1.8 | A |
Gecko | Camino 1.5 | OSX.3+ | 1.8 | A |
Misc | NetFront 3.1 | Embedded devices | - | C |
Misc | NetFront 3.4 | Embedded devices | - | A |
Misc | Dillo 0.8 | Embedded devices | - | X |
Misc | Links | Text only | - | X |
DataTables has the ability to read data from virtually any
JSON
data source that can be obtained by Ajax
. This can be done, in its most simple form, by setting the ajax
option to the address of the JSON
data source. The example below shows DataTables loading data for a table from arrays
as the data source (object parameters can also be used through the columns.data
option).
The information read from an
Ajax
data source can be arbitrarily complex, but still be displayed by DataTables through the columns.data
option, which is particularly useful for working with JSON
feeds in an already defined format. The columns.data
option has the ability to read information not only from objects, but also from arrays using the same dotted object syntax as for objects.
In some tables you might wish to have some content generated automatically. This examples shows the use of
columns.defaultContent
to create a button element in the last column of the table. A simple jQuery click
event listener is used to watch for clicks on the row, and when activated uses the row().data()
method to get the data for the row and show a bit of information about it in an alert box.
© 2015 - 2018. Limitless Web App Kitby Eugene Kopyov