How to have more columns than headers?
How to have more columns than headers?
Chris230291
Posts: 34Questions: 10Answers: 1
I would like to have a single column which displays a name. Using hidden <td hidden> tags I would like to have many, but an unknown and varying number of td tags. The idea is I can use the responsive plugin to show and hide the hidden data. It seems datatables requires a <thead> per <td> though. Is there any way around this without first calculating the maximum length of hidden <td hidden> tags and creating that number of <thead>'s?
EDIT: Example table
<table>
<tr>
<th>Name</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
</tr>
</table>
Answers
http://live.datatables.net/gesutuka/1/edit?html,js,output
Yep, you need to match the headers to the columns, if they're not, you'll see that error in your example.
It sounds though instead of using Responsive, you could use child rows instead. They're very similar, and look the same, so I suspect that would work for you instead,
Colin
OK thanks. I decided to created black cells where needed,