ITPUB??ì3
ITPUB论坛 » WEB 2.0技术 » 请教个疑难杂症:关于固定表格前2列和tr display属性在一起用出现的问题

新一届的微软MVP评选已经开始,欢迎各位推荐!

标题: 请教个疑难杂症:关于固定表格前2列和tr display属性在一起用出现的问题
离线 renncpc
初级会员



精华贴数 0
个人空间 0
技术积分 44 (30278)
社区积分 0 (143959)
注册日期 2004-8-27
论坛徽章:0
      
      

发表于 2007-1-23 13:54 
请教个疑难杂症:关于固定表格前2列和tr display属性在一起用出现的问题

附件中的网页,表格的滚动条往右边拖一下之后,再点击前面的钥匙会出现左边2列跳出表格外的问题。

望有解决此问题经验的朋友不吝赐教。




renncpc 上传了这个附件:
2007-1-23 13:54
  下载次数: 7
问题.rar (122.21 KB)
 
只看该作者    顶部
离线 ShadowKiller
不会跳舞的猪


精华贴数 0
个人空间 0
技术积分 636 (2988)
社区积分 19 (7775)
注册日期 2004-9-17
论坛徽章:2
管理团队成员开发板块每日发贴之星    
      

发表于 2007-1-26 13:00 
<TH class=fixed style="BACKGROUND-COLOR: #d3f3fe" noWrap rowSpan=2>指标名称</TH>
    <TH class=fixed style="BACKGROUND-COLOR: #d3f3fe" noWrap rowSpan=2>单 位</TH>


仔细看下你的 css样式。 class=fixed 。 去看下fixed是怎么写的。
这种问题一般都是样式运用引起的。

以后要别人解决问题。 要贴代码就贴全。


__________________
When you wanna get the most , there's no easy way out; when you ready to go and your heart left in doubt, Don't give up your faith , cause you can win, in this thing called love.Love can conquer all.
只看该作者    顶部
离线 ShadowKiller
不会跳舞的猪


精华贴数 0
个人空间 0
技术积分 636 (2988)
社区积分 19 (7775)
注册日期 2004-9-17
论坛徽章:2
管理团队成员开发板块每日发贴之星    
      

发表于 2007-1-26 13:11 
另外你这个表格设计的不好。 你可以采用在这个表格上再放一个只有这个表格前两列的表格。上面的表格用绝对定位。这样拖动横向滚动条的时候,只有下面的表格滚动,而上面的表格一直处于原来位置。

提一点点意见。 希望不要得罪你。
1.代码不具备跨浏览器的能力。
2.用到了<FONT>, ,这个东西让人感觉很不爽
3.<IMG src="统计资料_files/b_3_3.jpg"> ,存放图片的文件夹名字起得很有创意。 呵呵


__________________
When you wanna get the most , there's no easy way out; when you ready to go and your heart left in doubt, Don't give up your faith , cause you can win, in this thing called love.Love can conquer all.
只看该作者    顶部
离线 HorseShell
资深会员



精华贴数 0
个人空间 0
技术积分 1040 (1750)
社区积分 26 (6732)
注册日期 2007-1-26
论坛徽章:2
ITPUB新首页上线纪念徽章     
      

发表于 2007-1-26 15:25 
Re: 请教个疑难杂症:关于固定表格前2列和tr display属性在一起用出现的问题



QUOTE:
最初由 renncpc 发布
附件中的网页,表格的滚动条往右边拖一下之后,再点击前面的钥匙会出现左边2列跳出表格外的问题。

望有解决此问题经验的朋友不吝赐教。


Thanks
无比感激
Thanks
无比感激
Thanks
无比感激


只看该作者    顶部
离线 renncpc
初级会员



精华贴数 0
个人空间 0
技术积分 44 (30278)
社区积分 0 (143959)
注册日期 2004-8-27
论坛徽章:0
      
      

发表于 2007-1-26 15:55 
sorry,
.fixed{
        position:relative;
        background-color: white;
}


只看该作者    顶部
离线 renncpc
初级会员



精华贴数 0
个人空间 0
技术积分 44 (30278)
社区积分 0 (143959)
注册日期 2004-8-27
论坛徽章:0
      
      

发表于 2007-1-26 15:59 
您的前两点意见我个人没有办法改变,我们公司这一方面要迁就油田的标准。第三点是因为我把网页另存为桌面上了。


只看该作者    顶部
离线 justforregister
SAP


精华贴数 1
个人空间 10
技术积分 41058 (18)
社区积分 11493 (135)
注册日期 2005-6-10
论坛徽章:86
开发板块每日发贴之星ERP板块每日发贴之星    
      

发表于 2007-1-27 18:31 


QUOTE:
最初由 ShadowKiller 发布
另外你这个表格设计的不好。 你可以采用在这个表格上再放一个只有这个表格前两列的表格。上面的表格用绝对定位。这样拖动横向滚动条的时候,只有下面的表格滚动,而上面的表格一直处于原来位置。

提一点点意见。 希望不要得罪你。
1.代码不具备跨浏览器的能力。
2.用到了<FONT>, ,这个东西让人感觉很不爽
3.<IMG src="统计资料_files/b_3_3.jpg"> ,存放图片的文件夹名字起得很有创意。 呵呵


好专业哦; 佩服佩服


__________________
只看该作者    顶部
离线 ShadowKiller
不会跳舞的猪


精华贴数 0
个人空间 0
技术积分 636 (2988)
社区积分 19 (7775)
注册日期 2004-9-17
论坛徽章:2
管理团队成员开发板块每日发贴之星    
      

发表于 2007-1-29 15:54 


QUOTE:
最初由 renncpc 发布
sorry,
.fixed{
        position:relative;
        background-color: white;
}


position:relative  意思是相对位置。 position采用relative的元素,其位置是个相对位置,这就是导致你页面出现滚动条的时候,表格前两列跟着滚动条上下滚动的原因。

下面给出关于position 四个值得详细解释

The values of position have the following meanings:



static

The element's box is generated as normal. Block-level elements generate a rectangular box that is part of the document's flow, and inline-level boxes cause the creation of one or more line boxes that are flowed within their parent element.



relative

The element's box is offset by some distance. The element retains the shape it would have had were it not positioned, and the space that it would ordinarily have occupied is preserved.



absolute

The element's box is completely removed from the flow of the document and positioned with respect to its containing block, which may be another element in the document or the initial containing block (described in the next section). Whatever space the element might have occupied in the normal document flow is closed up, as though the element did not exist. The positioned element generates a block-level box, regardless of the type of box it would have generated if it were in the normal flow.



fixed

The element's box behaves as though it were set to absolute, but its containing block is the viewport itself.


__________________
When you wanna get the most , there's no easy way out; when you ready to go and your heart left in doubt, Don't give up your faith , cause you can win, in this thing called love.Love can conquer all.
只看该作者    顶部
离线 ShadowKiller
不会跳舞的猪


精华贴数 0
个人空间 0
技术积分 636 (2988)
社区积分 19 (7775)
注册日期 2004-9-17
论坛徽章:2
管理团队成员开发板块每日发贴之星    
      

发表于 2007-1-29 15:59 


QUOTE:
最初由 renncpc 发布
您的前两点意见我个人没有办法改变,我们公司这一方面要迁就油田的标准。第三点是因为我把网页另存为桌面上了。

代码跨浏览器是指,你们写的网页能不能在除了IE之外的浏览器运行,例如: Firefox 之类 或者其他。

不推荐使用<font>是有原因的,因为如果页面上字体要改,那么需要修改的<font>地方太多。 字体样式,颜色这些还是用CSS去定义的好。

这些和你们的客户是谁没有什么关系(如果你们客户非要让你们写这种代码,那就另当别论) ^_^


__________________
When you wanna get the most , there's no easy way out; when you ready to go and your heart left in doubt, Don't give up your faith , cause you can win, in this thing called love.Love can conquer all.
只看该作者    顶部
离线 ShadowKiller
不会跳舞的猪


精华贴数 0
个人空间 0
技术积分 636 (2988)
社区积分 19 (7775)
注册日期 2004-9-17
论坛徽章:2
管理团队成员开发板块每日发贴之星    
      

发表于 2007-1-29 16:01 
或许你可以尝试下
.fixed{
position:absolute;
background-color: white;
}


__________________
When you wanna get the most , there's no easy way out; when you ready to go and your heart left in doubt, Don't give up your faith , cause you can win, in this thing called love.Love can conquer all.
只看该作者    顶部
相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问