css固定表头不随滚动条移动.doc_第1页
css固定表头不随滚动条移动.doc_第2页
css固定表头不随滚动条移动.doc_第3页
css固定表头不随滚动条移动.doc_第4页
css固定表头不随滚动条移动.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

先说效果描述如图:涉及到数据保密的缘故所以数据弄掉了。效果为:整个grid数据会出现横向,竖向滚动条。其中所有的表头:操作,序号,测试1.。等等要素,不会随着竖向滚动条的滚动而发生下移动的变化。而“操作”,“序号”,“测试1”,“测试2”,“测试3”,“测试4”,“测试5”这几个列的要素则进行了横向固定,不会随横向滚动条的移动而移动。当横向滚动条向右边移动时,右边的要素往左边的移动部分会被左边的要素遮罩住。所以图里看到“测试6”,“测试7”直到“测试12”这几个title都被遮盖了,因为横向滚动条往右边移动了。把下面的css保存起来作为.css文件,然后在jsp页面进行引入div#DivContainer height:300px;overflow: auto; overflow-y: scorll;margin-top: -1px; table.lock border-collapse:collapse; border-right:gray 1px solid; border-bottom:gray 1px solid; border-color: gray; td.Locked /* TD标签水平与垂直方向锁住单元格, 不随鼠标或滚动条移动 */ z-index: 30; position: relative; top: expression(parentNode.parentNode.parentNode.parentNode.scrollTop); left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft); background-color: #cccccc; text-align: center; /*border-top: solid 0px gray; border-bottom: solid 1px gray; border-left: solid 0px gray; border-right: solid 1px gray; */border-left:gray 1px solid; border-top:gray 1px solid; th.Locked /* TH标签水平与垂直方向锁住单元格, 不随鼠标或滚动条移动 */ z-index: 30; position: relative; top: expression(parentNode.parentNode.parentNode.parentNode.scrollTop); left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft); background-color: #cccccc; text-align: center; /*border-top: solid 0px gray; border-bottom: solid 1px gray; border-left: solid 0px gray; border-right: solid 1px gray; */border-left:gray 1px solid; border-top:gray 0px solid; tr.TrLocked z-index: 30; position: relative; top: expression(parentNode.parentNode.parentNode.scrollTop); /*left: expression(parentNode.parentNode.parentNode.scrollLeft);*/ background-color: #cccccc; text-align: center; /*border-top: solid 0px gray; border-bottom: solid 1px gray; border-left: solid 0px gray; border-right: solid 1px gray; */border-left:gray 1px solid; border-top:gray 0px solid; th.HLocked /* TH标签水平方向锁住单元格 */ z-index: 1; position: relative; left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft); /*background-color: #cccccc; text-align: center;*/ /*border-top: solid 0px gray; border-bottom: solid 1px gray; border-left: solid 0px gray; border-right: solid 1px gray;*/*border-left:gray 1px solid; border-top:gray 1px solid;*/ background: no-repeat right top rgb(33, 136, 104); padding: 0px; border: 0px currentColor; text-align: center; color: rgb(235, 235, 235); font-weight: bold;font-size: 12px;height: 20px;th.other/*border-left:gray 1px solid; border-top:gray 1px solid;*/ background: no-repeat right top rgb(33, 136, 104); padding: 0px; border: 0px currentColor; text-align: center; color: rgb(235, 235, 235); font-weight: bold;font-size: 12px;height: 20px;th.VLocked /* TH标签垂直方向锁住单元格 */ z-index: 1; position: relative; top: expression(parentNode.parentNode.parentNode.parentNode.scrollTop); background-color: #cccccc; text-align: center; border-top: solid 0px gray; border-bottom: solid 1px gray; border-left: solid 0px gray; border-right: solid 1px gray; td.HLocked /* TD标签水平方向锁住单元格 */ z-index: 1; position: relative; left: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft); /*background-color: #cccccc; text-align: center; */ /*border-top: solid 0px gray; border-bottom: solid 1px gray; border-left: solid 0px gray; border-right: solid 1px gray;*/*border-left:gray 1px solid; border-top:gray 1px solid;*/ padding: 0px; border: 0px currentColor;font-size: 12px;height: 18px;text-align: center; td.VLocked /* TD标签垂直方向锁住单元格 */ z-index: 1; position: relative; top: expression(parentNode.parentNode.parentNode.parentNode.scrollTop); background-color: #cccccc; text-align: center; border-top: solid 0px gray; border-bottom: solid 1px gray; border-left: solid 0px gray; border-right: solid 1px gray; td.other/*border-left:gray 1px solid; border-top:gray 1px solid;*/ padding: 0px; border: 0px currentColor;font-size: 12px;height: 18px;text-align: center;jsp页面的结构样例 操作序号测试1测试2测试3测试4测试5测试6测

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论