开发者

How to make Asp.net Gridview header and first column frezee?

开发者 https://www.devze.com 2023-02-07 15:18 出处:网络
how to make html table header and first column frezee, my code is not work all web browser. Link: http://jsfiddle.net/avFBx/

how to make html table header and first column frezee, my code is not work all web browser.

Link: http://jsfiddle.net/avFBx/

How to make ?

css code:

.tbl th
        {
            background-color: Aqua;
            position: relative;
        }        
        .locked
        {
            background-color: Red;
            position: relative;
        }
        #divgrid
        {
            height: 150px;
            width: 350px;
            overflow: auto;
        }

html code:

<div id="divgrid">
        <table class="tbl">
            <tr>
                <th class="locked">
                    a
                </th>
                <th>
                    b
                </th>
                <th>
                    c
                </th>
                <th>
                    d
                </th>
                <th>
                    e
                </th>
            </tr>
            <tr>
                <td class="locked">
          开发者_高级运维          aaaaaaaaaaaaaaaa
                </td>
                <td>
                    aaaaaaaaaaaaaaaa
                </td>
                <td>
                    aaaaaaaaaaaaaaaa
                </td>
                <td>
                    aaaaaaaaaaaaaaaa
                </td>
                <td>
                    aaaaaaaaaaaaaaaa
                </td>
            </tr>
</table>
</div>


Check this demo out: FixedHeaderTable.com

It is entirely jQuery and does exactly what you're looking for.


I will try to put a div with another table of the same size inside the header table, and with css put the overflow scroll... but you have to be very carefull with your mesurments so they match... the headers witdth with the columns width...

Its tricky but I think it can work.

0

精彩评论

暂无评论...
验证码 换一张
取 消