Datatables contains "Show [dropdown] entries", for choosing how many rows the table should display at a time.
I know how to remove "Show [dropdown] entries" all together by removing the l
from this.
dom: '<"row"<"col-sm-6"l><"col-sm-6"f>>tp',
How do I remove the part "entries" of "Show [dropdown] entries"?
DOM added:
<div id="tableComputerPackages_length" class="dataTables_length">
<label>
Show
<select class="form-control input-sm" name="tableComputerPackages_length" aria-controls="tableComputerPackages">
entries
</label>
</div>
Simply change the language sLengthMenu
setting from "Show _MENU_ entries"
to
var table = $("#example").dataTable({
language : {
sLengthMenu: "Show _MENU_"
}
});
demo -> http://jsfiddle.net/wj32k7ck/
On Datatables 1.10 and up it's:
$('#example').dataTable( {
"language": {
"info": "Showing page _PAGE_ of _PAGES_"
}
});
Here's the full documentation.
As a bonus, if you want to tweak the length menu wording (i.e. show x entries) you do that like this:
$('#example').dataTable( {
"language": {
"lengthMenu": "Display _MENU_ records"
}
});
and here's the documentation for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With