Naruto Naruto - 11 months ago 70
JSON Question

How to show empty data message in Datatables

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

Answer Source

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