<table>
<tr>
<td colspan = "2"></td>
</tr>
<tr>
<td></td>
<td>
<div>//将scrollbar加在div所在层中</div>
</td>
</tr>
</table>不知道我的描述你是否明白!
<tr>
<td colspan = "2"></td>
</tr>
<tr>
<td></td>
<td>
<div>//将scrollbar加在div所在层中</div>
</td>
</tr>
</table>不知道我的描述你是否明白!
解决方案 »
- firstChild这个属性是不是废除了?
- JavaScript路径问题
- div里的table如何跟着div的大小而改变大变?
- iframe页面载入判断
- ********************************************谁能看到Object.prototype里面的东西吗???
- 这个用 onchange怎么实现 最好能帮写一下
- 如果根据 this 取得数组索引值?
- .net下, easyUI datagrid 导出生成EXECL?高分求救ing......
- 高分求教大虾!ie中打印如何实现分页打印?
- kindeditor上传图片,怎么默认打开本地图片啊?
- CSDN中无满意答案的层是怎么实现的
- javscript你们遇到过下面的问题没有?高手来解释下?
http://topic.csdn.net/u/20071101/15/7d91d365-c6ca-489e-a65c-ff06a4898ae7.html你这么写 同样破坏了 大表的完整
初始化 数据若固定的 前几行列是普通数据 还是算法问题
若是普通数据 还是 完整的初始化大表数据
不管用什么办法 取出 滚动数据
浮在上面 覆盖掉 原来大表的位置(也可以对大表再搞一下)
这样 两个容器都是 完整规范的 不需考虑附加别的标签
<head>
<title>行列锁定</title>
<style type="text/css">
table {
border: #a4cdf2 1px solid;
}
th {
border: #a4cdf2 1px solid;
font-family: "courier new";
font-size: 11pt;
background-color: #ffff82;
position: relative;
top: expression(document.getElementById("divTableContainer").scrollTop);
z-index: 10;
}
th.lock {
border: #a4cdf2 1px solid;
font-family: "courier new";
font-size: 11pt;
background-color: #ffff82;
position: relative;
top: expression(document.getElementById("divTableContainer").scrollTop);
left: expression(document.getElementById("divTableContainer").scrollLeft);
z-index: 10;
}
td.locked {
position: relative;
left: expression(document.getElementById("divTableContainer").scrollLeft);
background-color: #ffff82;
}
td {
border: #a4cdf2 1px solid;
font-family: "courier new";
font-size: 11pt;
} </style>
</head> <body>
<div id="divTableContainer" style="width: 298px; overflow: auto;">
<table cellpadding="0" cellspacing="0" id="tabTarget">
<tr>
<th nowrap class="lock">Column A</th>
<th nowrap>Column B</th>
<th nowrap>Column C</th>
<th nowrap>Column D</th>
<th nowrap>Column E</th>
</tr>
<tr>
<td class="locked">R1.1</td>
<td>R1.2</td>
<td>R1.3</td>
<td>R1.4</td>
<td>R1.5</td>
</tr>
<tr>
<td class="locked">R2.1</td>
<td>R2.2</td>
<td>R2.3</td>
<td>R2.4</td>
<td>R2.5</td>
</tr>
<tr>
<td class="locked">R3.1</td>
<td>R3.2</td>
<td>R3.3</td>
<td>R3.4</td>
<td>R3.5</td>
</tr>
</table>
</div>
</body></html>目前的效果是上下滚动正常,左右滚动时Column A单元格被盖掉了,只需解决这个问题即可!请各位帮忙
<th nowrap class="lock"> Column B </th>
<th nowrap class="lock"> Column C </th>
<th nowrap class="lock"> Column D </th>
<th nowrap class="lock"> Column E </th>
border: #a4cdf2 1px solid;
font-family: "courier new";
font-size: 11pt;
background-color: #ffff82;
position: relative;
top: expression(document.getElementById("divTableContainer").scrollTop);
left: expression(document.getElementById("divTableContainer").scrollLeft);
z-index: 11;
}
你在 不明确指定的情况下
表头一行的 th 都是 10
自然后出优先在上面
在明确指定 高出一层 11
后面的得 乖乖在下面相同 zIndex 后出的 如有位置冲突会盖先前的
expression
可能也有人用 IE 也不支持
乱地很
另:他上代码考过去 清清多于字符 不然没法用
<head>
<title> 行列锁定 </title>
<style type="text/css">
table{
border:#a4cdf2 1px solid;
}
th{
border: #a4cdf2 1px solid;
font-family: "courier new";
font-size: 11pt;
background-color: #ffff82;
position: relative;
top: expression(document.getElementById("divTableContainer").scrollTop);
z-index: 10;
}
th.lock{
border: #a4cdf2 1px solid;
font-family: "courier new";
font-size: 11pt;
background-color: #ffff82;
position: relative;
top: expression(document.getElementById("divTableContainer").scrollTop);
left: expression(document.getElementById("divTableContainer").scrollLeft);
z-index: 10;
}
th.left{
border: #a4cdf2 1px solid;
font-family: "courier new";
font-size: 11pt;
background-color: #ffff82;
position: relative;
top: expression(document.getElementById("divTableContainer").scrollTop);
left: expression(document.getElementById("divTableContainer").scrollLeft);
z-index: 12;
}
td.locked {
position: relative;
left: expression(document.getElementById("divTableContainer").scrollLeft);
background-color: #ffff82;
z-index: 11;
}
td {
border: #a4cdf2 1px solid;
font-family: "courier new";
font-size: 11pt;
} </style>
</head> <body>
<div id="divTableContainer" style="width: 298px; overflow: auto;">
<table cellpadding="0" cellspacing="0" id="tabTarget">
<tr>
<th nowrap class="left"> Column A </th>
<th nowrap> Column B </th>
<th nowrap> Column C </th>
<th nowrap> Column D </th>
<th nowrap> Column E </th> </tr>
<tr>
<td class="locked"> R1.1 </td>
<td> R1.2 </td>
<td> R1.3 </td>
<td> R1.4 </td>
<td> R1.5 </td>
</tr>
<tr>
<td class="locked"> R2.1 </td>
<td> R2.2 </td>
<td> R2.3 </td>
<td> R2.4 </td>
<td> R2.5 </td>
</tr>
<tr>
<td class="locked"> R3.1 </td>
<td> R3.2 </td>
<td> R3.3 </td>
<td> R3.4 </td>
<td> R3.5 </td>
</tr>
</table>
</div>
</body> </html>