Table cellPadding property
Table object
Definition and Usage
The cellpadding property specifies the space between the cell border and its content.
Syntax
Set the cellPadding property:
tableObject.cellPadding="
number
|
percent
"
Return the cellPadding property:
tableObject.cellPadding
Tip: The cellPadding property has no default value.
| Value | Description |
|---|---|
| number | Sets the space between the cell border and its content in pixels |
| percent | Sets the space between the cell border and its content as a percentage |
Browser support





All major browsers support the cellPadding property
Example
Example
Change the space between table cells and the space between the cell border and its content:
| cell 1 | cell 2 |
| cell 3 | cell 4 |
Try it »
Table object