You are here: Reference > HTML > attributes > cellPadding (table)

cellPadding attribute (table)

Browser support:
Specifies the amount of space between the border of a cell and its contents in a table.
Use the cellSpacing attribute if you want to set the space between cells.
JavaScript page for this attribute: cellPadding. You can find other example(s) there.

Possible values:

Sets the amount of space between the border of the cell and its contents.
One of the following values:
offset in pixels
Integer with or without a px (pixel) designator.
percentage
Integer higher than or equal to 0 , with a % designator.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the cellPadding attribute:
Table, with 10px cellpadding:
<table border="3px" cellpadding="10px">
    <tr>
        <td>Apple</td>
        <td>Pear</td>
        <td>Peach</td>
    </tr>
</table>

<br /><br />

Table, without cellpadding:
<table border="3px" cellpadding="0px">
    <tr>
        <td>Apple</td>
        <td>Pear</td>
        <td>Peach</td>
    </tr>
</table>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content