zoukankan      html  css  js  c++  java
  • 固定表格行列(expression)

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> New Document </title>
    <style>
    
    .FixedTitleRow
    {
       position: relative;
       top: expression(this.offsetParent.scrollTop);
       z-index: 10;
        80px;
       background-color: #FFCC00;
    }
     .FixedDataColumn
     { position: relative;
       left: expression(this.parentElement.offsetParent.parentElement.scrollLeft);
       background-color: #E6ECF0;
     }
     .FixedColumnAndRows{
       position: relative;
       top: expression(this.offsetParent.scrollTop);
       left: expression(this.offsetParent.scrollLeft);
       z-index: 20;
        80px;
       background-color: #FFCC00;
     }
     td{word-break : keep-all;}
    
    </style>
    </head>
    
    <body>
    <div id="scrollDiv" style="500; height:150; overflow: auto; cursor: default; display: inline; position: absolute;">
    <table width="100%"  cellpadding='0' cellspacing='0' bordercolor='lightgrey' border="1" style="table-layout:fixed">    
        <tr bgcolor="#FFCC00" style="font-size:12px; text-align:center; font-weight:bold;height:25px;">        
             <td class="FixedColumnAndRows">header</td>        
             <td class="FixedColumnAndRows">header</td>        
             <td class="FixedColumnAndRows">header</td>        
             <td class="FixedTitleRow">header</td>        
             <td class="FixedTitleRow">header</td>        
             <td class="FixedTitleRow">header</td>
       <td class="FixedTitleRow">header</td>        
             <td class="FixedTitleRow">header</td>        
             <td class="FixedTitleRow">header</td>        
             <td class="FixedTitleRow">header</td>        
             <td class="FixedTitleRow">header</td>        
             <td class="FixedTitleRow">header</td>        
        </tr>           
        <tr style="font-size:12px; text-align:center;height:20px;">        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
        </tr>   
        <tr style="font-size:12px; text-align:center;height:20px;">        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
        </tr> 
     <tr style="font-size:12px; text-align:center;height:20px;">        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
        </tr> 
     <tr style="font-size:12px; text-align:center;height:20px;">        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
        </tr>
     <tr style="font-size:12px; text-align:center;height:20px;">        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
        </tr>
     <tr style="font-size:12px; text-align:center;height:20px;">        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
        </tr>
     <tr style="font-size:12px; text-align:center;height:20px;">        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td class="FixedDataColumn">left</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
             <td>--</td>        
        </tr>
      </table>
    </body>
    </html>
    
    /* 这种固定行列的方式只适用于IE,并且只适用于数据量较少的情况.数据量很多时是非常耗资源的!*/

    from: http://mirror-100.blog.163.com/blog/static/105633532008761743297/

  • 相关阅读:
    [LeetCode 题解]: Remove Duplicates from Sorted List
    [LeetCode 题解]: Merge k Sorted Lists
    [LeetCode 题解]: Insertion Sort List
    [LeetCode 题解]:Candy
    求任意多边形面积 python实现
    C++飞机大战
    version robot
    python一段代码 感受一下
    微机原理上机第四次实验内容
    初步的百度爬虫
  • 原文地址:https://www.cnblogs.com/dyllove98/p/3215085.html
Copyright © 2011-2022 走看看