DATA Source DataTables

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 on it.
NamePositionSalaryOfficeCVStatusE-mailAction
Airi Satou Accountant $162,700 Tokyo hired a.satou@datatables.net
Angelica Ramos Chief Executive Officer (CEO) $1,200,000 London Pending a.ramos@datatables.net
Ashton Cox Junior Technical Author $86,000 San Francisco in process a.cox@datatables.net
Bradley Greer Software Engineer $132,000 London Pending b.greer@datatables.net
Brenden Wagner Software Engineer $206,850 San Francisco hired b.wagner@datatables.net
Brielle Williamson Integration Specialist $372,000 New York Pending b.williamson@datatables.net
Bruno Nash Software Engineer $163,500 London in process b.nash@datatables.net
Caesar Vance Pre-Sales Support $106,450 New York in process c.vance@datatables.net
Cara Stevens Sales Assistant $145,600 New York in process c.stevens@datatables.net
Cedric Kelly Senior Javascript Developer $433,060 Edinburgh in process c.kelly@datatables.net
NamePositionSalaryOfficeCVStatusE-mailAction
Showing 1 to 10 of 57 entries

Ajax sourced data

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 option to the address of the JSON data source.
NamePositionOfficeExtn.Start dateSalary
NamePositionOfficeExtn.Start dateSalary
Loading...
Showing 0 to 0 of 0 entries

Javascript sourced data

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 (like all other DataTables handled data, this can be arrays or objects using thecolumns.data option).A table must be available on the page for DataTables to use. This examples shows an empty table element being initialising as a DataTable with a set of data from a Javascript array. The columns in the table are dynamically created based on the columns.title configuration option.

Server-side processing

There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side options that DataTables provides. With server-side processing enabled, all paging, searching, ordering actions that DataTables performs are handed off to a server where an SQL engine (or similar) can perform these actions on the large data set (after all, that's what the database engine is designed for!). As such, each draw of the table will result in a new Ajax request being made to get the required data.Server-side processing is enabled by setting the serverSide:option option to true and providing an Ajax data source through the ajax:option option.
Processing...
First nameLast namePositionOfficeStart dateSalary
First nameLast namePositionOfficeStart dateSalary
Preview Settings

Try It Real Time

Layout Type
    • LTR
    • RTL
    • Box
Sidebar Type
Sidebar Icon
Unlimited Color
Light layout
Dark Layout
Mix Layout