我怎么让一个表格的一行固定,不随拖动条而变动,就是想达到表头固定
css应该能做到这点吧

解决方案 »

  1.   

    ASP.NET 里用过,页面上直接用就可以,附赠固定列,哈L@_@K/*
        固定表头:为 datagrid 添加属性 useaccessibleheader="true"。
        注:必须安装 FrameWork 1.1 sp1。须 IE5.0 或更高版本可用。
     */
    th 
    {
        line-height: 1.5em;
        color: #333333;
        background-color: #e3e3e3;
        border: #a4cdf2 1px solid;
        border-top-width: 2px;
        border-bottom-width: 2px;
        position: relative;
        top: expression(document.getElementById("divDatagrid").scrollTop);
        z-index: 10;
    }/* 
        固定列:为 asp:boundcolumn 添加属性 headerstyle-cssclass="locked" itemstyle-cssclass="locked"。
        注:须 IE5.0 或更高版本可用。
    */
    td.locked, th.locked {
        border: #a4cdf2 1px solid;
        position: relative;
        left: expression(document.getElementById("divDatagrid").scrollLeft);
    }/* Keeps the header as the top most item. Important for top left item */
    th.locked {z-index: 99;}
      

  2.   

    参考:
    http://community.csdn.net/Expert/topic/5345/5345647.xml?temp=.7157404