cellspacing attribute is used to create space
around (that is, outside of) table cells. Think of table cells as bricks,
cellspacing as the mortar in between. You
can change the thickness of that mortar by altering the
cellspacing value, as Figure 1 shows.
cellspacingvalues of five and ten pixels, respectively
There is a CSS-based alternative to the HTML
cellspacing attribute, called
border-spacing, but it is
not supported by Internet Explorer (even in version 8). You may use the
border-collapse property, setting it to
"collapse", which removes the need for a
cellspacing value of
does not solve the problem of setting larger cell spacing values. So while
it’s usually better to use the CSS approach, it may not possible for this
particular attribute, depending on what you are trying to achieve with
your tables, without ignoring what is currently the most commonly used
attribute is similar to the
cellpadding attribute, which is used to create space around the content
inside table cells.
cellspacing for this
<table border="1" cellspacing="5"> <tr> <th>Account Type</th> <th>Interest Rate</th> </tr> <tr> <td>Smart</td> <td>From 2%</td> </tr> <tr> <td>Young Saver</td> <td>From 1.6%</td> </tr> </table>
This attribute takes a numerical value, which reflects a pixel measurement.
It causes no compatibility issues, and has excellent support across all tested browsers.