日期:2014-05-17  浏览次数:20549 次

html table固定表头dtd问题
HTML code
[color=#FF0000]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[/color]
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <style type='text/css'>
tr.locktop{
  position:relative;
  top:expression((this.offsetParent.scrollTop>this.parentElement.parentElement.offsetTop?this.offsetParent.scrollTop-this.parentElement.parentElement.offsetTop-1:0)-1);
}

tr.fixTitle
{
 /*background: navy;
 color: white;*/
 position: relative;
 top: expression(this.offsetParent.scrollTop);
}
</style>
 </head>

 <BODY>
表头前面的内容,这些是可以滚出屏幕的,只有表头锁定。
<table id=pol_table_list cellspacing=0>
<tr class=fixTitle><th>表头
<tr><td>1
<tr><td>2
<tr><td>3
<tr><td>4
<tr><td>5
<tr><td>6
<tr><td>7
<tr><td>8
<tr><td>9
<tr><td>10
</table>
 </BODY>
</html>



我从网上找的固定表头的代码,是可以实现的 但是我加上DTD后就没效果了,这如何解决啊

------解决方案--------------------
ie9 加和没加一样