How to remove a Datatable table completely from the html page?

How to remove a Datatable table completely from the html page?

thomas_jones1990thomas_jones1990 Posts: 1Questions: 1Answers: 0

Hi,

I would like to remove a datatable completely, so that it is not visible anymore.

I can manage this (as a workaround) by:
$('#myDataTableId').addClass('invisible');

Alternatively, I am able to delete the shown contents of the table with:
dataTable.fnClearTable();
(dataTable.clear().draw(); does not work in my case).

But here the table header still remains.

How could I remove the table completely apart from setting it invisible (as shown above).

Thanks in advance!

This discussion has been closed.