how to change the show entries
how to change the show entries
Hello I am working on a Project, where I want to change the Shown entries.
First of all my Table starts with 10 shown entries, but I want to change it into 0 -100, because I don’t want the table to be seen from the beginning, I want an option where I can change it from 0 for example in to 10.
I used this CDN:
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.18/b-1.5.4/b-html5-1.5.4/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.18/b-1.5.4/b-html5-1.5.4/datatables.min.js"></script>
$(document).ready( function () {
$('#table_id').DataTable();
} );
Can someone help be out?
Or is there an Option to hide the table and let it been shown later per click?
Answers
https://datatables.net/reference/option/pageLength
and
https://datatables.net/reference/option/lengthMenu
like in here:
Here are a few options you can look at:
div
then on clicking a button or whatever you can show the div. Maybe ue jQueryhide()
andshow()
methods for this.ajax
ordata
to load the data. Then on a button click use jQuery's ajax method to fetch the data and userows.add()
to populate the Datatable.Kevin