1

I am trying to freeze first top three rows of my table while scrolling down.

Here's my code:

<table>
    <thead>
        <tr>
            <th>Item#</th>
            <td>12766</td>
        </tr>
        <tr>
            <th>LOC</th>
            <td>OWH</td>
        </tr>
        <tr>
            <th>Size/Qty</th>
            <td>12</td>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th>SAlES</th>
            <td>32132</td>
        </tr>
        <tr>
            <th>SAlES</th>
            <td>32132</td>
        </tr>
        <tr>
            <th>SAlES</th>
            <td>32132</td>
        </tr>
    </tbody>
</table>

I searched for many jQuery plugins, but they don't support multiple rows freezing.

Please advise.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
CairoCoder
  • 3,091
  • 11
  • 46
  • 68
  • 1
    If these first three rows have a special meaning, that would most likely justify putting them into a `thead` … and then you could fix that instead. – CBroe Aug 30 '14 at 00:20
  • Yes, they have a special meaning and I could put them in – CairoCoder Aug 30 '14 at 00:22
  • 1
    have a look [**here**](http://stackoverflow.com/questions/17067294/html-table-with-100-width-with-vertical-scroll-inside-tbody) – BeNdErR Aug 30 '14 at 00:40

1 Answers1

1

This plugin was useful, just as @CBroe mentiond, I have to put rows into thead first, then I used this plugin:

http://mkoryak.github.io/floatThead/#usage

CairoCoder
  • 3,091
  • 11
  • 46
  • 68