Multiple thead

Multiple thead

FlorentDescFlorentDesc Posts: 9Questions: 4Answers: 0
edited July 2015 in Free community support

Hi !
I'm trying to have some complex headers grouped by different <thead> to do some jquery on them.

Un example is better than thousand words :

<table>
    <thead>
        <tr>
            <th rowspan = 2>Header 1 </th>
            <th rowspan = 2>Header 2 </th>
            <th colspan = 2 >Header 3 </th>
        </tr>
        <tr>
            <th>Header 3-1 </th>
            <th>Header 3-2 </th>
        </tr>
    </thead>
    <thead class="menu">
        <tr>
            <th>Action 1 on header 1 </th>
            <th>Action 1 on header 2 </th>
            <th>Action 1 on header 3-1 </th>
            <th>Action 1 on header 3-2 </th>
        </tr>
        <tr>
            <th>Action 2 on header 1 </th>
            <th>Action 2 on header 2 </th>
            <th>Action 2 on header 3-1 </th>
            <th>Action 2 on header 3-2 </th>
        </tr>
    </thead>

    <tbody>
        ...
    </tbody>
</table>

I want to do that to be able, for instance, to hide $('.menu') with a jquery action or some things like that.

But, the issue is that only the first <thead> is taken into account, the other ones juste disappear.

Is there a way to keep them ?

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    Multiple thead elements is not valid HTML and is not supported by DataTables.

    Allan

  • FlorentDescFlorentDesc Posts: 9Questions: 4Answers: 0

    Okay, thank for answer =)

This discussion has been closed.