`
ryan_ncu
  • 浏览: 69885 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Html中 表单title头固定的CSS实现,类似于Excel中窗口冻结的功能

阅读更多

Html中 表单title头固定的CSS实现,类似于Excel中窗口冻结的功能,能很好的增强易用性

 

<style type="text/css">
<!--
.fixTop {
	Z-Index:102;
	position:relative;
	Top:expression(this.offsetParent.scrollTop);
}

.fixLeft {
	Z-Index:101;
	position:relative;
	left:expression(document.getElementById('scrollDiv').scrollLeft);
	background-color:#eeeeee;
}
-->
</style>

仅适用于IE:
<div id="scrollDiv" style="height: 200px; width:400px; overflow: auto;">
<table border=1 cellspacing="0" cellpadding="2">
    <tr class="fixTop" bgcolor="#eeeeee">
        <th class="fixLeft">
            LeftTop
        </th>
		<th colspan="9" align=left>
			Top
		</th>
    </tr>    
   <tr height="50">
	   <td  class="fixLeft">Left</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
   </tr>
   <tr height="50">
	   <td  class="fixLeft">Left</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
   </tr>

   <tr height="50">
	   <td  class="fixLeft">Left</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
   </tr>

   <tr>
	   <td  class="fixLeft">Left</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
   </tr>

   <tr>
	   <td  class="fixLeft">Left</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
   </tr>

   <tr>
	   <td  class="fixLeft">Left</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
	   <td>abcdefg</td>
   </tr>

</table>
</div>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics