garand / sticky

jQuery Plugin for Sticky Objects
Other
3.3k stars 1.06k forks source link

Make sticky works with table headers #234

Open PVGrad opened 8 years ago

PVGrad commented 8 years ago

This patch is for proper positioning table header on sticky state (position: fixed) Please take into concideration that you should apply sticky like this:

HTML:

<table>
    <thead>
        <tr class="sticky">
            <th>Id</th>
            <th>Name</th>
            <th>Value</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>Test</td>
            <td>1</td>
        </tr>
    </tbody>
</table>

JS: $('.sticky').sticky();

desfero commented 7 years ago

up

Oz-Hershco commented 6 years ago

Hi I'm currently using this code here(table.zip) to create a table from an XML file. I added the class to the tag inside the as you suggested but it seems the sticky still doesn't work for some reason. Any idea why this is happening?

Here's the HTML code:

zhangshenhua commented 5 years ago

otherwise image