|
Cellpadding
is the area or "padding" around the contents of a table's
cell. It can also be defined as the amount of space between the
border and the content, in pixels.
For
example, if the HTML syntax is <table border=0 cellpadding=5
cellspacing=0> the table produced will have a 5-pixel padding
around the entire inside wall of the cell, moving your content
inward by 5 pixels.
If
the HTML syntax reads <table border=0 cellpadding=20 cellspacing=0> the
table produced will have a 20-pixel padding around the entire inside
wall of the cell, moving your content inward by 20 pixels.
|
This table has been defined with a cellpadding of 5 pixels. As you can see the text has
a 5-pixel "padding" in all directions from
the edge of cell.
|
|
This table has been defined with a cellpadding of 20 pixels. As
you can see the text has a 20-pixel "padding" in
all directions from the edge of cell.
|
NOTE: Cellspacing
and cellpadding look similar, but the concepts are very different.
Cellpadding adds a slightly larger space, and should always be used
to give the text some breathing room, particularly when a table border
is visible or text is in the next table cell.
See
also cellspacing.
|