我正在尝试添加一个在单元格之间留有空格的表格,因为单元格的背景色是白色,表格的背景色是蓝色,您可以轻松地看到padding和margin无效(我将其应用于td
),它只会在单元内部增加空间。
Answers:
您要border-spacing
:
<table style="border-spacing: 10px;">
或在某处的CSS块中:
table {
border-spacing: 10px;
}
见怪异模式上border-spacing
。请注意,这border-spacing
不适用于IE7及以下版本。
table {
border-spacing: 10px;
}
一旦我删除,这对我有用
border-collapse: separate;
从我的桌子标签。
假设cellspcing
/ cellpadding
/border-spacing
属性没有工作,你可以使用代码如下。
<div class="form-group">
<table width="100%" cellspacing="2px" style="border-spacing: 10px;">
<tr>
<td width="47%">
<input type="submit" class="form-control btn btn-info" id="submit" name="Submit" />
</td>
<td width="5%"></td>
<td width="47%">
<input type="reset" class="form-control btn btn-info" id="reset" name="Reset" />
</td>
</tr>
</table>
</div>
我已经尝试过并成功使用表宽度分隔按钮,并将2或1%的空td设置为空,则返回的值没有更多不同。