130

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.

micstr
  • 5,080
  • 8
  • 48
  • 76
nickL
  • 1,536
  • 2
  • 10
  • 15

5 Answers5

327

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).

BMH
  • 4,280
  • 1
  • 18
  • 18
  • 3
    This is a better answer than mine, if all you want to do is hide it. If you need to style it, its nice that Allan has wrapped each element in it's own class so you can get at it. – Daiku Oct 18 '13 at 11:54
  • I like this answer best too because it keeps it directed to the dataTable params but thanks Daiku too as I have some choice...Nick – nickL Oct 18 '13 at 21:24
  • This makes the "editable" table type break (impossible to edit or save rows). – sveti petar Nov 11 '15 at 14:44
  • @jovan I don't think this option can interfere with "editable". Do you have an example (jsfiddle maybe) I can look into it for you? – BMH Dec 08 '15 at 10:21
  • 1
    @BMH I got it to work - to be honest, I don't even remember what the problem was any more! – sveti petar Dec 09 '15 at 10:44
  • After set ```info: false```, there is still a ```
    ``` element before the div that contains the pagination links.
    – JCarlosR Apr 07 '17 at 17:15
  • in R, with the DT library it can be done with the following code: datatable(the_data,options(bInfo = FALSE)) – amann Mar 31 '21 at 07:48
21

try this for hide

$('#table_id').DataTable({
  "info": false
});

and try this for change label

$('#table_id').DataTable({
 "oLanguage": {
               "sInfo" : "Showing _START_ to _END_ of _TOTAL_ entries",// text you want show for info section
            },

});
mamal
  • 1,791
  • 20
  • 14
10

If you also need to disable the drop-down (not to hide the text) then set the lengthChange option to false

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

Works for DataTables 1.10+

Read more in the official documentation

Arian Acosta
  • 6,491
  • 1
  • 35
  • 32
6

Now, this seems to work:

$('#example').DataTable({
  "info": false
});

it hides that div, altogether

Irf
  • 4,285
  • 3
  • 36
  • 49
0

It is Work for me:

language:{"infoEmpty": "No records available",}
Saulius
  • 1
  • 2
  • 2
    This does not appear to answer the question, which asks for a way to suppress the message when there _are_ records. Looks like you are changing the message to be shown with there are no records, which is not the problem that OP is asking about. – JohnRC Aug 20 '20 at 13:32