<SCRIPT LANGUAGE="JavaScript">
<!--
function fixupFirstRow(tab)
{
var div = tab.parentNode;
if(div.className.toLowerCase() == "datagrid")
{
tab.rows[0].style.zIndex = "1";
tab.rows[0].style.position = "relative";
div.onscroll = function()
{
var tr = tab.rows[0];
tr.style.top = this.scrollTop - (this.scrollTop==0 ? 1 : 2);
tr.style.left = -1;
}
}
}
window.onload = function()
{
var tab = document.getElementById("coolGrid1");
if(tab) fixupFirstRow(tab);
}
//-->
</SCRIPT>
<div class=datagrid style="width: 100%; height: 60; overflow: auto;">
<table id=coolGrid1 class="coolGrid" cellSpacing=0 cellPadding=2 borderStyle=2 altRowColor="oldlace">
<col><col><col><col><col><col>
<thead>
<tr align=center bgcolor=yellow>
<td nowrap>First Name</td>
<td nowrap>Last Name</td>
<td nowrap>Team</td>
<td nowrap>Engine</td>
<td nowrap>Tires</td>
<td nowrap>Fastest Lap</td>
</tr>
</thead>
<tbody>
<tr>
<td>Michael</td>
<td>Schumacher</td>
<td>Ferrari</td>
<td>Ferrari</td>
<td>Bridgestone</td>
<td>1.15.872</td>
</tr>
<tr>
<td>Michael</td>
<td>Schumacher</td>
<td>Ferrari</td>
<td>Ferrari</td>
<td>Bridgestone</td>
<td>1.15.872</td>
</tr>
<tr>
<td>Michael</td>
<td>Schumacher</td>
<td>Ferrari</td>
<td>Ferrari</td>
<td>Bridgestone</td>
<td>1.15.872</td>
</tr>
<tr>
<td>Michael</td>
<td>Schumacher</td>
<td>Ferrari</td>
<td>Ferrari</td>
<td>Bridgestone</td>
<td>1.15.872</td>
</tr>
</tbody>
</table>
</div>
<!--
function fixupFirstRow(tab)
{
var div = tab.parentNode;
if(div.className.toLowerCase() == "datagrid")
{
tab.rows[0].style.zIndex = "1";
tab.rows[0].style.position = "relative";
div.onscroll = function()
{
var tr = tab.rows[0];
tr.style.top = this.scrollTop - (this.scrollTop==0 ? 1 : 2);
tr.style.left = -1;
}
}
}
window.onload = function()
{
var tab = document.getElementById("coolGrid1");
if(tab) fixupFirstRow(tab);
}
//-->
</SCRIPT>
<div class=datagrid style="width: 100%; height: 60; overflow: auto;">
<table id=coolGrid1 class="coolGrid" cellSpacing=0 cellPadding=2 borderStyle=2 altRowColor="oldlace">
<col><col><col><col><col><col>
<thead>
<tr align=center bgcolor=yellow>
<td nowrap>First Name</td>
<td nowrap>Last Name</td>
<td nowrap>Team</td>
<td nowrap>Engine</td>
<td nowrap>Tires</td>
<td nowrap>Fastest Lap</td>
</tr>
</thead>
<tbody>
<tr>
<td>Michael</td>
<td>Schumacher</td>
<td>Ferrari</td>
<td>Ferrari</td>
<td>Bridgestone</td>
<td>1.15.872</td>
</tr>
<tr>
<td>Michael</td>
<td>Schumacher</td>
<td>Ferrari</td>
<td>Ferrari</td>
<td>Bridgestone</td>
<td>1.15.872</td>
</tr>
<tr>
<td>Michael</td>
<td>Schumacher</td>
<td>Ferrari</td>
<td>Ferrari</td>
<td>Bridgestone</td>
<td>1.15.872</td>
</tr>
<tr>
<td>Michael</td>
<td>Schumacher</td>
<td>Ferrari</td>
<td>Ferrari</td>
<td>Bridgestone</td>
<td>1.15.872</td>
</tr>
</tbody>
</table>
</div>
解决方案 »
- UI框架,找的你好辛苦,你在哪?
- 加载页面弹出加载提示的问题,高手进,急。。
- document.createElement("object")要怎么用,让flash显示出来?
- 50分求FX中滚动效果校正
- 我在一台机子上,安装 IE、FireFox、Netscap 浏览器 用来测试程序,会不会互相影响,测试不准确??
- rico怎么不运行。
- 求助~~~~~~~~~~~~~~~~~~~··
- JavaScript编程,实现在状态栏里显示鼠标坐标
- 在JavaScript里,怎样判断一个文件夹是否共享,文件是否存在?
- uibootstrap时区问题,选择日期跟传递的参数不是一个是怎么回事
- 不用window.open用什么?求相关代码
- 往table中加入行、列的代码到底该怎么写?我的代码错在哪里?怎么修改才正确?
http://jkisjk.vip.sina.com/html/fixHeadTr2.htm固定Table首行首列(20041123)
http://jkisjk.vip.sina.com/html/fixHeadTr3.htm
哪个高手帮我看一下。