Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Table cellPadding property

Table cellPadding property

Table Object Reference 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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:

Runoob Tutorial(runoob.com)

        

        

        

        

cell 1 cell 2
cell 3 cell 4

Try it »


Table Object Reference Table object