答案 0 :(得分:0)
您可以使用以下
<td style="display:none">your html here</td>
以及
$('#your_table').DataTable( {
"columnDefs": [
{
"targets": [ column_number_you_want_to_hide ],
"visible": false,
},
]
});
知道列号从0开始,而不是1。
答案 1 :(得分:0)
此代码解决了问题 http://live.datatables.net/yaxusisi/1/edit
$(document).ready(function() {
// Create the DataTable
var table = $("#example").DataTable({
orderCellsTop: true,
initComplete: function() {
var table = this.api();
// Add filtering
table.columns([1,2]).every(function() {
var that = this;
// Create the `select` element
var input = $('<input type="text" />')
.appendTo($("thead tr:eq(1) td").eq(this.index()))
.on("keyup", function() {
that.search('^' + $(this).val() + '$', true, false).draw();
});
});
displaySearch();
}
});
});