Bootstrap DataTables integration provides a renderer for the pagination control in DataTables to ensure that the pagination of the table is also styled consistently by Bootstrap. It also provide sorting and searching. It enable to download the data as csv.
HTML Part
Employee Name | Designation | Office | Age | Date | Salary |
---|---|---|---|---|---|
Tiger Nixon | System Architect | Edinburgh | 61 | 2011/04/25 | 320,800 |
Fiona Green | Chief Operating Officer (COO) | San Francisco | 48 | 2010/03/11 | 850,000 |
Shou Itou | Regional Marketing | Tokyo | 20 | 2011/08/14 | 163,000 |
Michelle House | Integration Specialist | Sidney | 37 | 2011/06/02 | 95,400 |
Serge Baldwin | Data Coordinator | Singapore | 64 | 2017/04/09 | 138,575 |
Zenaida Frank | Software Engineer | New York | 63 | 2010/01/04 | 125,250 |
Zorita Serrano | Software Engineer | San Francisco | 56 | 2017/06/01 | 115,000 |
Jennifer Acosta | Junior Javascript Developer | Edinburgh | 43 | 2013/02/01 | 75,650 |
Cara Stevens | Sales Assistant | New York | 46 | 2011/12/06 | 145,600 |
Hermione Butler | Regional Director | London | 47 | 2011/03/21 | 356,250 |
Lael Greer | Systems Administrator | London | 21 | 2009/02/27 | 103,600 |
Jonas Alexander | Developer | San Francisco | 30 | 2010/07/14 | 86,600 |
Shad Decker | Regional Director | Edinburgh | 51 | 2008/11/13 | 183,000 |
Michael Bruce | Javascript Developer | Singapore | 29 | 2011/06/27 | 183,000 |
Donna Snider | Customer Support | New York | 27 | 2011/01/25 | 112,000 |
CSS Part
JavaScript Part
$(document).ready(function() { $('#example').DataTable({ "order": [[0, "asc"]]/* First column in ascending order */, dom: 'Bfrtip', "pageLength": 5, /* Number of records */ buttons: [ { extend: 'csv', exportOptions: { columns: [0, 1, 2, 3, 4] } }, ] }); });