I\'m having problems with the Bootstrap-Table plugin: https://github.com/wenzhixin/bootstrap-table
I have a hidden ID column in the table I need to hide. But I can\'t do
You almost got it right, the problem is that your jQuery selector is wrong.
Css's :nth-child
doesn't start at 0
;)
This will work:
$('#delegateTable').bootstrapTable({
onPostBody : function() {
$('#delegateTable').find('th:nth-child(1), tr td:nth-child(1)').hide();
alert('column hidden');
}
});
See this example.
You can also replace this javascript with CSS:
#delegateTable th:nth-child(1), #delegateTable tr td:nth-child(1){
display: none;
}