`

Table列头固定,数据行与列头对齐方法

 
阅读更多
<style   type="text/css">  
  .td_relative  
  {  
          background-color:  #CCCCCC;  
          top: expression(document.getElementById("dv").scrollTop);  
          position : relative;  
          z-index : 1  
  }  
  </style>


<div class="tablebgcolor" id="dv" align=center style="border: 1 solid #000080 ;height:300;
width: 80%; overflow: auto; ">

  <TABLE align="center" border="1" cellspacing="0" width="100%" cellpadding="0" class="tablebgcolor" >
<TR bgcolor=#e2e2e2 class="text" >
<td class="td_relative"  valign="top" align="left">
                    序列
              </td>
              <td class="td_relative"  valign="top" align="left">
                    市场代码
              </td>
              <td class="td_relative"  valign="top" align="left">
                    市场描述
              </td> 
              <td class="td_relative" valign="top" align="left">
                    所属国家代码
              </td>
              <td class="td_relative" valign="top" align="left">
                    有效性(Y/N)
              </td>  
              <td class="td_relative"  valign="top" align="left">
                    创建时间      
              </td>  
        </TR>

            </td>
           
            <td width="20%"  valign="top" align="left" class="text">
                <%=marketDec %>&nbsp;
            </td> 
            <td width="20%"  valign="top" align="left" class="text">
                <%=conName %>&nbsp;
            </td>
            <td width="15%"  valign="top" align="left" class="text">
                <%=valid %>&nbsp;
            </td>  
            <td width="20%"  valign="top" align="left" class="text">
                <%=rec_time %>&nbsp;
            </td>
           
  </tr>
</TABLE>
分享到:
评论
Global site tag (gtag.js) - Google Analytics