通过样式表实现固定表头和列

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 15:40 点击:

 

<html>

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">

    <title>固定表头和列</title>

    <style>

        .FixedTitleRow

        {

            position: relative;

            top: expression(this.offsetParent.scrollTop);

            z-index: 10;

            background-color: #E6ECF0;

        }

       

        .FixedTitleColumn

        {

            position: relative;

            left: expression(this.parentElement.offsetParent.scrollLeft);

        }

       

        .FixedDataColumn

        {

            position: relative;

            left: expression(this.parentElement.offsetParent.parentElement.scrollLeft);

            background-color: #E6ECF0;

        }

    </style>

</head>

<body>

   <div id="scrollDiv" style="width: 300px; overflow: auto; cursor: default; display: inline;

        position: absolute; height: 200px;">

        <table id='accountTable' width='500' height='230' cellpadding='0' cellspacing='0'

            style='table-layout: auto' bordercolor='lightgrey'>

            <tbody>

                <tr class="FixedTitleRow">

                    <td class="FixedTitleColumn">

                        ID0</td>

                    <td class="FixedTitleColumn">

                        CK0</td>

                    <td class="FixedTitleColumn">

                        Code0</td>

                    <td class="FixedTitleColumn">

                     

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • WordPress添加百度喜欢按钮小技巧
      • Wordpress 博客如何实现自定义Gravatar头像
      • 网站设计分析:建立良好的视觉层级
      • 网站设计分析:“中国式设计”的三个方向
      • 案例分析:奥巴马筹款网站的制作过程
      • 创建不平衡的平衡:在网页设计中使用不对称设计
      • 7大主流B2C首页导航栏设计对比分析
      • Wordpress页面模板制作方法及使用
      • css控制文字前的小图标
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1