1<link href="//cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css">
2<script src="//cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
3
4<table id="Table_ID">
5 <thead>
6 <tr>
7 <th>Table_Head_1</th>
8 <th>Table_Head_2</th>
9 <th>Table_Head_3</th>
10 </tr>
11 </thead>
12 <tbody>
13 <tr>
14 <td>Table_Data_1</td>
15 <td>Table_Data_2</td>
16 <td>Table_Data_3</td>
17 </tr>
18 </tbody>
19</table>
20
21<script>
22$(document).ready( function () {
23 $('#Table_ID').DataTable();
24} );
25</script>
1 dom: 'Blfrtip',
2 buttons: [
3 {
4 extend: 'excelHtml5',
5 footer: true,
6 },
7 {
8 extend: 'csvHtml5',
9 footer: true,
10 },
11 {
12 extend: 'pdfHtml5',
13 footer: true,
14 },
15 ],
16 lengthMenu: [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
1Javascript12345678var table = $('#example').DataTable( { buttons: [ 'copy', 'excel', 'pdf' ]} ); table.buttons().container() .appendTo( $('.col-sm-6:eq(0)', table.table().container() ) );