HTML table cellspacing 屬性
實例
把表格單元格間距設置為10 像素:
<table border="1"
cellspacing="10">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
嘗試一下»
瀏覽器支持
所有主流瀏覽器都支持cellspacing 屬性。
定義和用法
HTML5不支持<table> cellspacing屬性。
cellspacing 屬性規定單元之間的空間,以像素計。
注意:請勿將該屬性與cellpadding屬性相混淆,cellpadding屬性規定的是單元邊沿與單元內容之間的空間。
語法
<table cellspacing="pixels">
屬性值
值 | 描述 |
---|---|
pixels | 规定单元之间的空间。 |
HTML <table>標籤