"searching": false, // Search Box will Be Disabled
"ordering": false, // Ordering (Sorting on Each Column)will Be Disabled
"info": true, // Will show "1 to n of n entries" Text at bottom
"lengthChange": false // Will Disabled Record number per page
Add this option:
"bInfo": false
I solve it like that. Use bootstrap 4
$(document).ready(function () {
$('#table').DataTable({
"searching": false,
"paging": false,
"info": false
});
});
cdn js:
cdn css:
This is key answer to this post "bLengthChange": false,
will hide the Entries Dropdown
You can try this also.
simply hide it from CSS by using,
.dataTables_length {
display: none;
}
Both will work.
If you're using Angular you can use the following code to do the same.
in component.html
<table id="" datatable [dtOptions]="dtOptions" class="table dataTable">
and in your component.ts
dtOptions: any = {}
this.dtOptions = {
searching: true, //enables the search bar
info: false //disables the entry information
}
there more option for data table available please visit here to learn more
To disable the "Show Entries" label, add the code dom: 'Bfrtip' or you can add "bInfo": false
$('#example').DataTable({
dom: 'Bfrtip'
})
To disable the "Show Entries" label, use "bInfo", example: "bFilter" is the search component, but are active by default.
$(document).ready( function () {
$('#example').dataTable( {
"bInfo": false
} );
} );
Enable or disable the table information display. This shows information about the data that is currently visible on the page, including information about filtered data if that action is being performed.
sDom: "Tfrtip" or via a callback:
"fnHeaderCallback": function(){
$('#YOURTABLENAME-table_length').hide();
}
To hide "show entries" but still have pagination. I used the code below and it worked.
"bPaginate": true,
"bLengthChange": false,
"bFilter": true,
"bInfo": false,
"bAutoWidth": false
If using Datatable > 1.1.0 then lengthChange
option is what you need as below :
$('#example').dataTable( {
"lengthChange": false
});
Just write :
$(document).ready( function () {
$('#example').dataTable( {
"lengthChange": false
} );
} );
Source: Stackoverflow.com