How to show empty data message in Datatables

Naruto picture Naruto · Jan 17, 2013 · Viewed 108.7k times · Source

Suppose i get empty data from server sometimes, i want to display No Data found message in DataTables?. How is this possible?

Answer

Daniel picture Daniel · Jan 17, 2013

If you want to customize the message that being shown on empty table use this:

$('#example').dataTable( {
    "oLanguage": {
        "sEmptyTable":     "My Custom Message On Empty Table"
    }
} );

Since Datatable 1.10 you can do the following:

$('#example').DataTable( {
    "language": {
        "emptyTable":     "My Custom Message On Empty Table"
    }
} );

For the complete availble datatables custom messages for the table take a look at the following link reference/option/language