
HTML <table> 标签
把表格单元格间距设置为 10 像素:
<table border="1" cellspacing="10">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<td>January</td>
<td>$100</td>
</table>
所有主流浏览器都支持 cellspacing 属性。
HTML5 不支持 <table> cellspacing 属性。
cellspacing 属性规定单元之间的空间,以像素计。若不设置该属性,则其默认值为 cellspacing="2"。
<b>注意:</b>请勿将该属性与 cellpadding 属性相混淆,cellpadding 属性规定的是单元边沿与单元内容之间的空间。
<table cellspacing="pixels">
值
描述
pixels
规定单元之间的空间。
