filamentgroup / tablesaw

A group of plugins for responsive tables.
MIT License
5.48k stars 434 forks source link

Colgroups in column toggle mode #326

Closed apdrsn closed 5 years ago

apdrsn commented 6 years ago

Hi. Thanks for this great plugin.

Is there any way of making <col />s inside <colgroup /> display: none when their column is being ticked off?

So if tick off the second column, a class will also be applied to the second <col />

<table data-tablesaw-mode="columntoggle" data-tablesaw-minimap>
    <colgroup>
        <col />
        <col />
        <col />
    </colgroup>

    <thead>
        <tr>
            <th data-tablesaw-priority="persist">Table header 1</th>
            <th data-tablesaw-priority="1">Table header 2</th>
            <th data-tablesaw-priority="2">Table header 3</th>
        </tr>
    </thead>

    <tbody>
        <tr>
            <td>Table data 1</td>
            <td>Table data 2</td>
            <td>Table data 3</td>
        </tr>
    </tbody>
</table>

Regards, Anders

zachleat commented 6 years ago

Hey @apdrsn, sorry to push back here a bit but functionally speaking what does <col> provide over the class add/remove stuff on <th>/<td> that we do now?

zachleat commented 5 years ago

This is an automated message to let you know that this issue requires additional input from the original poster and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

Do not let the issue’s closing deter you. After you’ve supplied the required information, the issue will be reopened. Thanks!

apdrsn commented 5 years ago

Hey @zachleat :)

Never noticed that you answered – sorry about that.

We are using <col> to control the widths of our columns by using classes. So if we hide a column without hiding the <col> we will have a miscalculation in columns.

Did that make sense?