asp.net.ph

Skip Navigation Links

CELLSPACING Attribute | cellSpacing Property

Language References


Sets or retrieves the amount of space between cells in a table.

Syntax


Inline <TABLE CELLSPACING = iSpacing [ % ] ... >
Script table.cellSpacing = iSpacing ]

Possible Values


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.

Remarks

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.

Example

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 

Applies To

TABLE

See Also

cellPadding



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note