当我想切换数据表的可见性时,如何隐藏 jQuery 数据表?问题是,如果我编写 hide 语句,它只会隐藏行,而不隐藏页眉和页脚。如何完全隐藏数据表?
为了隐藏,我使用了以下代码:
var oTable = $('#example').dataTable(); // 'example is the table id'
oTable.hide();
最佳答案
试试这个
$('#example').parents('div.dataTables_wrapper').first().hide();
关于jquery - 如何隐藏 jQuery 数据表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15827867/