问题描述
|
我在我的项目中使用Vaadin,目前我遇到了问题。这是CSS / HTML问题,我不知道该如何解决...
所以情况看起来像这样:
我有如下的HTML结构(CustomLayout):
<table>
<tr>
<td location=\"loc11\"></td>
<td location=\"loc12\"></td>
</tr>
<tr>
<td location=\"loc21\"></td>
<td location=\"loc22\"></td>
</tr>
(...)
</table>
我正在使用location = \“ xxx \”将数据插入到td中,该数据位于某些位置,而不是每个人。 CSS看起来像这样:
table.metric_table_layout tr td {
border-bottom: 1px dotted grey !important;
}
这是问题所在:
如果td为空,则边框会完全破坏我的布局。
有人可以给我一些CSS(在IE 7+中也可以使用)解决此问题吗?
我不想使用JS,所以我不确定是否只能使用CSS来处理?
谢谢
齐姆
解决方法
尝试添加:
table.metric_table_layout {
border-collapse:separate;
empty-cells:hide;
}
但是在IE8中,必须有一个“ 3”定义。
,仅使用CSS,您可以使用empty-cells:hide
属性。跨浏览器存在很多问题,因此需要进行一些预览(在IEtester的IE7中渲染正常-我只需要将边框定义为#ccc而不是灰色即可)
范例:http://jsfiddle.net/EbvXQ/11/