How to change standard empty datatable table message

I use datatable to list and sort the results.

This is how I initialized the datatable

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

It works great. But I need to change the empty message of the default table No data available in table to No records found . Please, help.

+5
source share
2 answers

$ ('# example'). dataTable ({"oLanguage": {"sEmptyTable": "My user message on an empty table"}});

Link: http://datatables.net/forums/discussion/2327/how-to-localize-the-string-no-data-available-in-table

+9
source

Ajinkya's answer should still work, because the library currently supports backward compatibility with the old version, but with later 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 the search results are empty):

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

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

+4
source

All Articles