How to show empty data message in Datatables

前端 未结 7 1430
感动是毒
感动是毒 2020-12-07 20:04

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

相关标签:
7条回答
  • 2020-12-07 20:35

    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

    0 讨论(0)
提交回复
热议问题