HTML <table> 標籤的 cellspacing 屬性

實例

下面的例子把表格單元格間距設定為 10 畫素:

<table border="8" cellspacing="10">
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>

定義和用法

cellspacing 屬性規定單元格之間的空間。

註釋:請勿將該屬性與 cellpadding 屬性相混淆,cellpadding 屬性規定的是單元邊沿與單元內容之間的空間。

語法

<body cellspacing="value">

屬性值

描述
pixels 規定單元之間的空間。