How to have more columns than headers?

How to have more columns than headers?

Chris230291Chris230291 Posts: 34Questions: 10Answers: 1
edited October 2021 in General

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

Sign In or Register to comment.