Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Whats is the difference between cellspacing and cellpadding

Aug 17, 2011 8:03PM PDT

waht are teh uses and difference between cell spacing/padding

Discussion is locked

- Collapse -
Whats is the difference between cellspacing and cellpadding
Aug 17, 2011 9:33PM PDT

Cell padding is used for formatting purpose
which is used to specify the space needed between the edges of the cells
and also in the cell contents.
The general format of specifying cell padding is as follows:
< table width="100" border="2" cellpadding="5">
The above adds 5 pixels of padding inside each cell .
Cell Spacing:
Cell spacing is one also used f formatting but there is a major
difference between cell padding and cell spacing. It is as follows: Cell
padding is used to set extra space which is used to separate cell walls
from their contents. But in contrast cell spacing is used to set space
between cells.

The general format of specifying cell spacing is as follows:
< table width="100" border="2" cellspacing="20">

One can also apply cell spacing and cell padding together. It is done as follows:
< table width="100" border="2" cellpadding="5" cellspacing ="20">


Note: This post was edited by a forum moderator to delete a self-promoting link, which is prohibited in these forums, on 08/18/2011 at 6:05 AM PT

- Collapse -
The difference is
Aug 18, 2011 12:27AM PDT

Cell spacing refers to the spacing between cells and cell padding is the spacing within the cell itself.

~Sovereign