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.
Name Position Salary Office CV Status E-mail Action
Tiger Nixon System Architect $320,800 Edinburgh hired
Garrett Winters Accountant $170,750 Tokyo Pending
Ashton Cox Junior Technical Author $86,000 San Francisco in process
Cedric Kelly Senior Javascript Developer $433,060 Edinburgh in process
Airi Satou Accountant $162,700 Tokyo hired
Brielle Williamson Integration Specialist $372,000 New York Pending
Herrod Chandler Sales Assistant $137,500 San Francisco in process
Rhona Davidson Integration Specialist $327,900 Tokyo hired
Colleen Hurst Javascript Developer $205,500 San Francisco Pending
Sonya Frost Software Engineer $103,600 Edinburgh in process
Jena Gaines Office Manager $90,560 London hired
Quinn Flynn Support Lead $342,000 Edinburgh in process
Charde Marshall Regional Director $470,600 San Francisco in process
Haley Kennedy Senior Marketing Designer $313,500 London hired
Tatyana Fitzpatrick Regional Director $385,750 London Pending
Michael Silva Marketing Designer $198,500 London in process
Paul Byrd Chief Financial Officer (CFO) $725,000 New York in process
Gloria Little Systems Administrator $237,500 New York hired
Bradley Greer Software Engineer $132,000 London Pending
Dai Rios Personnel Lead $217,500 Edinburgh in process
Jenette Caldwell Development Lead $345,000 New York hired
Yuri Berry Chief Marketing Officer (CMO) $675,000 New York Pending
Caesar Vance Pre-Sales Support $106,450 New York in process
Doris Wilder Sales Assistant $85,600 Sidney hired
Angelica Ramos Chief Executive Officer (CEO) $1,200,000 London Pending
Gavin Joyce Developer $92,575 Edinburgh in process
Jennifer Chang Regional Director $357,650 Singapore hired
Brenden Wagner Software Engineer $206,850 San Francisco hired
Fiona Green Chief Operating Officer (COO) $850,000 San Francisco Pending
Shou Itou Regional Marketing $163,000 Tokyo in process
Michelle House Integration Specialist $95,400 Sidney hired
Suki Burks Developer $114,500 London Pending
Prescott Bartlett Technical Author $145,000 London in process
Gavin Cortez Team Leader $235,500 San Francisco hired
Martena Mccray Post-Sales support $324,050 Edinburgh hired
Unity Butler Marketing Designer $85,675 San Francisco Pending
Howard Hatfield Office Manager $164,500 San Francisco in process
Hope Fuentes Secretary $109,850 San Francisco hired
Vivian Harrell Financial Controller $452,500 San Francisco Pending
Timothy Mooney Office Manager $136,200 London in process
Jackson Bradshaw Director $645,750 New York hired
Olivia Liang Support Engineer $234,500 Singapore Pending
Bruno Nash Software Engineer $163,500 London in process
Sakura Yamamoto Support Engineer $139,575 Tokyo Pending
Thor Walton Developer $98,540 New York in process
Finn Camacho Support Engineer $87,500 San Francisco hired
Serge Baldwin Data Coordinator $138,575 Singapore Pending
Zenaida Frank Software Engineer $125,250 New York in process
Zorita Serrano Software Engineer $115,000 San Francisco hired
Jennifer Acosta Junior Javascript Developer $75,650 Edinburgh Pending
Cara Stevens Sales Assistant $145,600 New York in process
Hermione Butler Regional Director $356,250 London hired
Lael Greer Systems Administrator $103,500 London Pending
Jonas Alexander Developer $86,500 San Francisco in process
Shad Decker Regional Director $183,000 Edinburgh hired
Michael Bruce Javascript Developer $183,000 Singapore hired
Donna Snider Customer Support $112,000 New York hired
Name Position Salary Office CV Status E-mail Action

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.
Name Position Office Extn. Start date Salary
Name Position Office Extn. Start date Salary

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 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.
First name Last name Position Office Start date Salary Action
First name Last name Position Office Start date Salary Action