DataTables / FixedHeader

Fix the header, footer, left or right columns of a table in place, to always show them when scrolling
http://www.datatables.net/
Other
75 stars 83 forks source link

Eliminating extra td elements in thead with 'left' or 'right' options #30

Open jacelys opened 10 years ago

jacelys commented 10 years ago

Suppose that I have a table with two rows in thead. As far as I know, one suggested practice in this case is to use td elements in one row, like:

<thead>
    <tr class="col-nums">
        <td>1</td>
        <td>2</td>
        <td>3</td>
    </tr>
    <tr class="col-names">
        <th>Name1</th>
        <th>Name2</th>
        <th>Name3</th>
    </tr>
</thead>

Fixing the left or right two columns, for example, would be accomplished with: new FixedHeader(table, {"left": 2}); new FixedHeader(table, {"right": 2});

Unfortunately, FixedHeader fails to remove the extra td elements in this case. The fix seems to be straightforward.

DataTables commented 10 years ago

It looks like there are actually quite a number of places where this error is occurring in the code. I need to look at it a bit closer and resolve this for all of the clone options.

I'm going to be releasing FixedHeader today in its current state, but I'll look into this when I can once the release process is done.

Thanks for flagging this up.