How to hide “Showing 1 of N Entries” with the data

2019-01-31 22:50发布

问题:

How do you remove the "Showing 1 of N entries" line of text on a dataTable (that is when using the javascript library dataTables? I think I was looking for something along these lines...

 $('#example').dataTable({
      "showNEntries" : false
       });

Pretty sure this is a simple one, but cannot seem to find it in the docs.

回答1:

You can remove it with the bInfo option (http://datatables.net/usage/features#bInfo)

   $('#example').dataTable({
       "bInfo" : false
   });

Update: Since Datatables 1.10.* this option can be used as info, bInfo still works in current nightly build (1.10.10).



回答2:

To disable the drop down set the lengthChange option to false

$('#datatable').dataTable( {
  "lengthChange": false
} );

Works for DataTables 1.10+

Read more in the official documentation