Answers for "using datatables"

10

datatable

<link href="//cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css">
<script src="//cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>

<table id="Table_ID">
  <thead>
    <tr>
        <th>Table_Head_1</th>
        <th>Table_Head_2</th>
        <th>Table_Head_3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
    	<td>Table_Data_1</td>
      	<td>Table_Data_2</td>
      	<td>Table_Data_3</td>
    </tr>
  </tbody>
</table>

<script>
$(document).ready( function () {
    $('#Table_ID').DataTable();
} );
</script>
Posted by: Guest on August-26-2020
1

datatable setup

$('table').dataTable({
	lengthChange: false, //visable show {row} entries
	info : false, // hide showing entries bottom
    pagingType: "first_last_numbers", // showing bottom number
    searching: false, //hide search
    aLengthMenu: [[5, 10, 25, -1], [5, 10, 25, "All"]], // set show {row} entries
	iDisplayLength: 5 // num of rows
});
Posted by: Guest on June-30-2021
0

datatable

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.22/datatables.min.css"/>
 
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.22/datatables.min.js"></script>
Posted by: Guest on October-05-2020

Browse Popular Code Answers by Language