2012-04-27 216 views
0

我已经应用于表格CSS宽度和最小宽度

width: auto; 
min-width: 98.5%; 

以下样式,当我在铬浏览器看其是内部一个div似乎具有内含div的仅约50%的宽度的表。在IE9中,表格占据了整个宽度。在Chrome中,当我看到使用F12应用的样式时,这两种样式均已应用且未跨过。

.containing > table { 
position: relative; 
left: 0; 
margin-right: 0; 
top: 0; 
border: 1px solid #DDD; 
width: auto; 
min-width: 98.5%; 
margin-bottom: 1em; 
-webkit-border-bottom-right-radius: 8px; 
-webkit-border-bottom-left-radius: 8px; 
-moz-border-radius-bottomright: 8px; 
-moz-border-radius-bottomleft: 8px; 
border-bottom-right-radius: 8px; 
border-bottom-left-radius: 8px; 
} 

HTML:

<div class="containing"> 
<table> 

</table> 
</div> 
+1

可能重复:[http://stackoverflow.com/q/7084990/419956](http://stackoverflow.com/q/7084990/419956) – Jeroen 2012-04-27 10:12:26

+0

顺便说一句,如果你的示例更“简单”,它会有所帮助。例如,边界半径规则与问题无关。这使得其他人更容易帮助你。 – Jeroen 2012-04-27 10:13:37

回答

1

嘿,我应该定义边界半径在你的表,如果你想边境

没有定义,我认为你在你的DIV的定义边界和边界半径像这样

检查前ex。 http://jsfiddle.net/RfWWh/

,并根据您的设计调整..