Need to show custom info message in data table hea

2019-08-17 13:20发布

问题:

I need to add custom info in datatable header.Please refer below pic for more reference.

Any idea how to achieve this ?

回答1:

You can do that by inserting Custom Element in DOM positioning of DataTable.

DataTables inserts DOM elements around the table to control DataTables features, and you can make use of this mechanism as well to insert your own custom elements.

For example:

$('#example').DataTable( {
   "dom": '<"toolbar">frtip'
} );

$("div.toolbar").html('<b>Custom tool bar! Text/images etc.</b>');

See this example for demonstration.



标签: datatables