2011-08-17 48 views
0

嘿我正在用一些CSS设计一个服务器生成的表格(我试图证明Telerick控件被高估了,但这是一个不同的讨论)。Chrome是否符合CSS表规格?

无论如何,这些表格在IE8和Firefox中看起来不错,而且风格完全如我所料。但是,该表看起来像Chrome中的垃圾。不要误会我的意思,Chrome是一款出色的浏览器,而且我通常使用的是;然而,它可能在特定方面缺乏。

所以基本上我问的是:Chrome是否有CSS和表格问题,或者我只是在CSS上吮吸(而IE和FF正确地预测我的吮吸)?

更新:问题是表(设置为宽度:100%)超过其父容器,它具有边界到整个事情。此外,底部的寻呼机行将其边框顶部的属性设置为“虚线”,但其中的一列是固定的!?

/*-------------Grid------------*/ 
table.grid 
{ 
    width: 100%; 
} 

.grid tr th 
{ 
    background-color: #696969; 
    background-image: url('/Images/grid-bg.png'); 
    color: White; 
    height: 20px; 
    padding: 3px; 
    text-align: left; 
} 

.grid td, .grid th 
{ 
    border-right: 1px solid white; 
} 

.grid th a:hover, .grid th a:link 
{ 
    color: White; 
    text-decoration: none; 
    display:inline-block; 
    width: 100%; 
    height: 100%; 
} 

.grid th a:hover 
{ 
    background-color: #696969; 
} 

.grid tr.even 
{ 
    background-color: #EBF2FC; 
} 

div.grid 
{ 
    border: 1px solid #5D7FA6; 
    padding: 1px 0px 1px 1px; 
} 

.pager 
{ 
    border-top: 1px dotted #5D7FA6; 
} 

.data-row 
{ 
    height: 24px; 
} 

.grid tr.data-row:hover 
{ 
    color:White; 
    background-color: #5D7FA6; 
} 
+1

很难说没有看到你的代码。你*可能*做错了什么。 Chrome *可能会做错事。 – thirtydot

+0

然后,如果有什么地方有足够的错误让Google无法通过各种CSS CSS规范,那么在acid3测试中它可能不会获得100%的回报:) – Blindy

回答

0

如果没有看到test case,你仍然很难确切地告诉你要更改什么。

但是,试试box-sizing: border-box。请参阅:https://developer.mozilla.org/en/CSS/box-sizing

一下添加到东西table.griddiv.grid?):

-moz-box-sizing: border-box; 
-webkit-box-sizing: border-box; 
box-sizing: border-box; 
+0

我不需要改变任何东西,因为我只需要支持IE浏览器(看起来很好)哈哈 但是,这种方式是否将周围的框或表本身? – badBadCoder

+0

我更新了我的答案,先试试其中的一个。 – thirtydot

+0

另请参阅:http://stackoverflow.com/q/7079070/405015 – thirtydot