- JQuery
Include the CSS and JS code for DataTables to the head and bottom of the body of your website, respectively. CSS is not required.
<link rel="stylesheet" type="text/css" href= "{{ url_for('static',filename='style.css') }}">
<script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
Use the single function bellow to call to initialise the tabl. Do not forget to add an id tag to the table.
$(document).ready(function(){
$('#myTable').DataTable();
});
Add options like so:
$(document).ready(function() {
$('#myTable').DataTable( {
"columnDefs": [
{ "orderable": false, "targets": [2,3,4] }
],
"paging": false,
"order": [[ 0, "asc" ]]
} );
} );