How to hide “Showing 1 of N Entries” with the dataTables.js library

前端 未结 5 2164
囚心锁ツ
囚心锁ツ 2020-12-13 05:23

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

相关标签:
5条回答
  • 2020-12-13 05:50

    Now, this seems to work:

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

    it hides that div, altogether

    0 讨论(0)
  • 2020-12-13 05:54

    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
                },
    
    });
    
    0 讨论(0)
  • 2020-12-13 05:55

    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

    0 讨论(0)
  • 2020-12-13 05:59

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

    0 讨论(0)
  • 2020-12-13 06:06

    It is Work for me:

    language:{"infoEmpty": "No records available",}
    
    0 讨论(0)
提交回复
热议问题