filamentgroup / tablesaw

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

Throwing error for multiple thead rows with colspan #288

Closed kmmathis closed 5 years ago

kmmathis commented 7 years ago

I'm attempting to use stack mode with a table that has multiple header rows, one of which uses colspan. Is this possible using Tablesaw?

I'm getting the following JavaScript error: Uncaught TypeError: Cannot read property 'cloneNode' of undefined

Referring to this line of code: https://github.com/filamentgroup/tablesaw/blob/master/dist/tablesaw.jquery.js#L384

Here is my HTML for reference

<table class="tablesaw tablesaw-stack" data-tablesaw-mode="stack">
    <thead>
        <tr>
            <th>Name</th>
            <th>Category</th>
            <th colspan="8">Product Types</th>
        </tr>
        <tr>
            <th></th>
            <th></th>
            <th>Column Name 1</th>
            <th>Column Name 2</th>
            <th>Column Name 3</th>
            <th>Column Name 4</th>
            <th>Column Name 5</th>
            <th>Column Name 6</th>
            <th>Column Name 7</th>
            <th>Column Name 8</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Value</td>
            <td>Value</td>
            <td>Value</td>
            <td></td>
            <td>Value</td>
            <td>Value</td>
            <td></td>
            <td></td>
            <td>Value</td>
            <td></td>
        </tr>
        <tr>
            <td>Value</td>
            <td>Value</td>
            <td></td>
            <td>Value</td>
            <td>Value</td>
            <td>Value</td>
            <td></td>
            <td>Value</td>
            <td>Value</td>
            <td>Value</td>
        </tr>
    </tbody>
</table>
zachleat commented 7 years ago

Yeah, this should definitely work. Are you on the latest version?

zachleat commented 6 years ago

A bunch of colspan bug fixes and rework went into 3.0.6. Please retest after that goes stable!

zachleat commented 5 years ago

Just confirmed that this was not fixed in 3.0.6. But it is a duplicate of #344, tracking over there.