I am using Datatables jQuery plugin and I have the following columns in html:
<tbody>
<td class="test1">elem1</td>
<td class="test2" style="display: none;">elem2</td>
</tbody>
I activate one or the other column from jQuery ( always one ). Problem is that 'datatables' plugin yells error because num of columns from tbody is not equal with num of columns from thead (1 in my case 'cause I only want one to display).
Is there a workaround for defining more columns than specified in the header and pass validation ?
- I am writing the html thought Django's template language.
- For showing columns I use something like this:
<select onchange="selectChange(this.value)"> <option>test1</option> <option>test2</option> </select> function selectChange(val) { $(`[class*="test"]`).hide(); $(`[class="${val}"]`).show(); }