简体   繁体   English

表格宽度超出容器 div

[英]Table width overshoots container div

I have a div with:我有一个 div:

position: absolute;
margin: 0px;
left: 0px;
right: 0px;
top: 58px;
bottom: 0px;
height: 439px;
width: 880px;
z-index: 1;
visibility: visible;
display: block;

It contains a div and a table.它包含一个 div 和一个表格。 The table tag had width=100% , cellspacing=0 and cellpadding=0 .表格标签有width=100%cellspacing=0cellpadding=0

When I see this in Firefox with Firebug I can see that the table goes beyond the div boundaries.当我在带有 Firebug 的 Firefox 中看到这一点时,我可以看到该表超出了 div 边界。 How do I make the table width exactly 100% of the div.如何使表格宽度恰好为 div 的 100%。 In another question asked on this site i saw that the border-collapse:collapse;在这个网站上提出的另一个问题中,我看到了border-collapse:collapse; in the CSS could cause this behaviour.在 CSS 中可能会导致这种行为。 Hence I have removed that with no effect!因此,我已将其删除,但没有任何效果!

Any help would be appreciated!任何帮助,将不胜感激! Thanks谢谢

In the fiddle below I modified width to 500px to see the whole div and Chrome/FF debugger shows no problem at all.在下面的小提琴中,我将宽度修改为 500px 以查看整个 div,Chrome/FF 调试器显示完全没有问题。

fiddle: http://jsfiddle.net/fzqH5/2/小提琴: http://jsfiddle.net/fzqH5/2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM