table-cell divs不正确调整大小 [英] table-cell divs not sizing correctly
问题描述
显示为表格单元格的我的div的大小不正确。我将宽度设置为91px,但它呈现在90.2667px。这是在Firefox,但我没有测试其他浏览器。
My divs that are displayed as table-cells are not sizing correctly. I set the width to 91px but it's rendered at 90.2667px. This is in Firefox, but I haven't tested other browsers.
以下是当我检查的元素:
Here is what comes up when I inspect the element:
width 90.2667px
.OrderCell3 → 91px inline:1
一旦我禁用display:table-cell,它就会变宽到91px。
As soon as I disable "display:table-cell" it widens to 91px exactly. However I need it to display this way to look the way I want.
编辑:这里是小提琴: http://jsfiddle.net/dKuj5/
Here is the Fiddle: http://jsfiddle.net/dKuj5/
推荐答案
我看到您的代码中没有表格,
当它是表数据时很有趣。
i see no tables in your code,
Funny, when it is table-data.
似乎你试图让一个滚动表。
如果是这样,那么重新考虑你的代码,而你可以从一个真实的表。
It seems like you tried to get a way to make a scrolling table. If that's so, then reconsider your code , while you can achieve it from a real table.
http://dabblet.com/gist/5648624 它使用em,但它可以是px或%。
http://dabblet.com/gist/5648624 it's using em, but it can be px or % .
诀窍是,来自thead的tfoot克隆,所以你的col布局应该保留在header(footer)之下
容器幻灯片,而不是tbody。
The trick is , a tfoot clone from thead, so your col layout should stay under header(footer) The container slides, not tbody.
这篇关于table-cell divs不正确调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!