使用css在单元格(td)之间添加空格 [英] Add space between cells (td) using css

查看:1087
本文介绍了使用css在单元格(td)之间添加空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在单元格之间添加一个带有空格的表格,因为单元格的背景颜色为白色,表格的背景颜色为蓝色,您可以很容易看到填充和边距不工作(我将其应用于 td ),它将只添加单元格内部的空间。

I am trying to add a table with space between cell as the background colour of the cell is white and the background color of the table is blue, you can easily see that padding and margin are not working (I am applying it to the td), it will only add space inside of the cell.

推荐答案

p>您要 border-spacing

<table style="border-spacing: 10px;">

或在某个地方的CSS块中:

Or in a CSS block somewhere:

table {
  border-spacing: 10px;
}

请参阅 border-spacing 上的css / tables.html#borderspacing> quirksmode 。请注意, border-spacing 在IE7及以下版本中无法使用。

See quirksmode on border-spacing. Be aware that border-spacing does not work on IE7 and below.

这篇关于使用css在单元格(td)之间添加空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆