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
Tiger NixonSystem Architect$320,800Edinburgh hiredt.nixon@datatables.net
Garrett WintersAccountant$170,750Tokyo Pendingg.winters@datatables.net
Ashton CoxJunior Technical Author$86,000San Francisco in processa.cox@datatables.net
Cedric KellySenior Javascript Developer$433,060Edinburgh in processc.kelly@datatables.net
Airi SatouAccountant$162,700Tokyo hireda.satou@datatables.net
Brielle WilliamsonIntegration Specialist$372,000New York Pendingb.williamson@datatables.net
Herrod ChandlerSales Assistant$137,500San Francisco in processh.chandler@datatables.net
Rhona DavidsonIntegration Specialist$327,900Tokyo hiredr.davidson@datatables.net
Colleen HurstJavascript Developer$205,500San Francisco Pendingc.hurst@datatables.net
Sonya FrostSoftware Engineer$103,600Edinburgh in processs.frost@datatables.net
Jena GainesOffice Manager$90,560London hiredj.gaines@datatables.net
Quinn FlynnSupport Lead$342,000Edinburgh in processq.flynn@datatables.net
Charde MarshallRegional Director$470,600San Francisco in processc.marshall@datatables.net
Haley KennedySenior Marketing Designer$313,500London hiredh.kennedy@datatables.net
Tatyana FitzpatrickRegional Director$385,750London Pendingt.fitzpatrick@datatables.net
Michael SilvaMarketing Designer$198,500London in processm.silva@datatables.net
Paul ByrdChief Financial Officer (CFO)$725,000New York in processp.byrd@datatables.net
Gloria LittleSystems Administrator$237,500New York hiredg.little@datatables.net
Bradley GreerSoftware Engineer$132,000London Pendingb.greer@datatables.net
Dai RiosPersonnel Lead$217,500Edinburgh in processd.rios@datatables.net
Jenette CaldwellDevelopment Lead$345,000New York hiredj.caldwell@datatables.net
Yuri BerryChief Marketing Officer (CMO)$675,000New York Pendingy.berry@datatables.net
Caesar VancePre-Sales Support$106,450New York in processc.vance@datatables.net
Doris WilderSales Assistant$85,600Sidney hiredd.wilder@datatables.net
Angelica RamosChief Executive Officer (CEO)$1,200,000London Pendinga.ramos@datatables.net
Gavin JoyceDeveloper$92,575Edinburgh in processg.joyce@datatables.net
Jennifer ChangRegional Director$357,650Singapore hiredj.chang@datatables.net
Brenden WagnerSoftware Engineer$206,850San Francisco hiredb.wagner@datatables.net
Fiona GreenChief Operating Officer (COO)$850,000San Francisco Pendingf.green@datatables.net
Shou ItouRegional Marketing$163,000Tokyo in processs.itou@datatables.net
Michelle HouseIntegration Specialist$95,400Sidney hiredm.house@datatables.net
Suki BurksDeveloper$114,500London Pendings.burks@datatables.net
Prescott BartlettTechnical Author$145,000London in processp.bartlett@datatables.net
Gavin CortezTeam Leader$235,500San Francisco hiredg.cortez@datatables.net
Martena MccrayPost-Sales support$324,050Edinburgh hiredm.mccray@datatables.net
Unity ButlerMarketing Designer$85,675San Francisco Pendingu.butler@datatables.net
Howard HatfieldOffice Manager$164,500San Francisco in processh.hatfield@datatables.net
Hope FuentesSecretary$109,850San Francisco hiredh.fuentes@datatables.net
Vivian HarrellFinancial Controller$452,500San Francisco Pendingv.harrell@datatables.net
Timothy MooneyOffice Manager$136,200London in processt.mooney@datatables.net
Jackson BradshawDirector$645,750New York hiredj.bradshaw@datatables.net
Olivia LiangSupport Engineer$234,500Singapore Pendingo.liang@datatables.net
Bruno NashSoftware Engineer$163,500London in processb.nash@datatables.net
Sakura YamamotoSupport Engineer$139,575Tokyo Pendings.yamamoto@datatables.net
Thor WaltonDeveloper$98,540New York in processt.walton@datatables.net
Finn CamachoSupport Engineer$87,500San Francisco hiredf.camacho@datatables.net
Serge BaldwinData Coordinator$138,575Singapore Pendings.baldwin@datatables.net
Zenaida FrankSoftware Engineer$125,250New York in processz.frank@datatables.net
Zorita SerranoSoftware Engineer$115,000San Francisco hiredz.serrano@datatables.net
Jennifer AcostaJunior Javascript Developer$75,650Edinburgh Pendingj.acosta@datatables.net
Cara StevensSales Assistant$145,600New York in processc.stevens@datatables.net
Hermione ButlerRegional Director$356,250London hiredh.butler@datatables.net
Lael GreerSystems Administrator$103,500London Pendingl.greer@datatables.net
Jonas AlexanderDeveloper$86,500San Francisco in processj.alexander@datatables.net
Shad DeckerRegional Director$183,000Edinburgh hireds.decker@datatables.net
Michael BruceJavascript Developer$183,000Singapore hiredm.bruce@datatables.net
Donna SniderCustomer Support$112,000New York hiredd.snider@datatables.net
NamePositionSalaryOfficeCVStatusE-mailAction
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
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.

First nameLast namePositionOfficeStart dateSalary
First nameLast namePositionOfficeStart dateSalary