Language References
Sets or retrieves the amount of space between cells in a table.
Inline |
<TABLE CELLSPACING = iSpacing [ % ] ... > |
Script |
table.cellSpacing = iSpacing ] |
iSpacing |
Integer specifying the amount of space between the border and the content, in pixels. |
iSpacing% |
Integer followed by a percent sign ( % ). This indicates the amount of space between the border and the content as a percentage of the available space. |
The property is read/write with no default value.
This attribute specifies how much space the browser should leave between the left side of the table and the left-hand side of the leftmost column, the top of the table and the top side of the topmost row, and so on for the right and bottom of the table.
In effect, the attribute also specifies the amount of space to leave between cells.
The following example demonstrates use of both the CSS CELLSPACING style attribute and the cellSpacing property.
<table id="theTable" border cellSpacing=10>
<tr>
<th>Header 1</td>
<th>Header 2</th>
<th>Header 3</th></tr>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td></tr>
</table>
<br>
<button onclick="theTable.cellSpacing=15">More</button>
<button onclick="theTable.cellSpacing=10">Reset</button>
<button onclick="theTable.cellSpacing=5">Less</button>
This feature requires Microsoft® Internet Explorer® 4.0 or later.
Show me
TABLE
cellPadding