datatable table.clear().draw() with data code example
Example: datatables clear table
const table = $("#yourTable").DataTable();
table.clear().draw(); // make sure to call draw() to see the table empty
const table = $("#yourTable").DataTable();
table.clear().draw(); // make sure to call draw() to see the table empty