Cellpadding and Cellspacing

Cellpadding and Cellspacing Attributes

The cellspacing and cellpadding attribute can, of course, be used together to format your tables. Once again the cellpadding attribute puts space around the inside the cell between the content and the cell wall. The cellspacing attribute puts space around the outside of the cell between the cell and the table row.

This table has no cellpadding or cellspacing

This cell is aligned left and spans 3 columns
This cell is center aligned and spans 3 columns
data cell 1 data cell 2 data cell 3
This cell is aligned right and spans 3 columns






This table has a cellpadding of 10 and cellspacing of 10

This cell is aligned left and spans 3 columns
This cell is center aligned and spans 3 columns
data cell 1 data cell 2 data cell 3
This cell is aligned right and spans 3 columns












This table has a cellpadding of 10 and cellspacing of 50

This cell is aligned left and spans 3 columns
This cell is center aligned and spans 3 columns
data cell 1 data cell 2 data cell 3
This cell is aligned right and spans 3 columns












This table has a cellpadding of 50 and cellspacing of 10

This cell is aligned left and spans 3 columns
This cell is center aligned and spans 3 columns
data cell 1 data cell 2 data cell 3
This cell is aligned right and spans 3 columns