一个Table问题:
我的要求是表头不动 内容跟着滚动条动
已经搜到的结果是:
给Table加DIV,并给表头加样式如:
tr {
position:relative;
background:#000;
}
这样 拉动滚条 表头就不动了! 效果也达到了!
接下来引发了新问题:
当我的Table里有 标签(我举个例子) 并给标签加了样式
如:a.fontbutton{......}
a.fontbutton:hover{......}
a.fontbutton:active{......}
详细
这样当滚条滚动后,再碰标签,表头就跑上面去了!
也就是表内容的样式一变,表头的位置就变了!
问题不知道描述清楚没有,这个问题我该怎么解决呢?
[color=brown]十分谢谢各位!!![/color]
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Layout html,body { margin:0; font:12px/180% Verdana, Arial; text-align:center; } div { width:800px; height:100px; overflow-y:scroll; } table { border:none; } .id { width:200px; } .name { width:300px; } .age { width:300px; } thead tr { position:relative; background:#f0f0f0; } a.fontbutton{font-size:12px; color:#a65600;} a.fontbutton:hover{font-size:12px; font-weight:bold; color:#a65600;} a.fontbutton:active{font-size:12px; font-weight:bold; color:#a65600;}