How to Change datatable default empty table message

后端 未结 2 460
青春惊慌失措
青春惊慌失措 2021-01-17 10:25

I am using datatable to list and sort the results.

This is how i initialized datatable

$(\'#example1\').DataTable({bFilter: false, bInfo: false, paging

2条回答
  •  醉话见心
    2021-01-17 10:57

    The answer by Ajinkya should still work because the library currently maintains backward compatibility with the old option format, but with more recent versions of the DataTables library (1.10+) you should use:

    $('#example').dataTable( {
        "language": {
          "emptyTable": "No data available in table"
        }
    } );
    

    See: https://datatables.net/reference/option/language.emptyTable

    Also, if you want to customize the info line when the table (or search results are empty):

    $('#example').dataTable( {
      "language": {
        "infoEmpty": "No entries to show"
      }
    } );
    

    See: https://datatables.net/reference/option/language.infoEmpty

提交回复
热议问题