How is Cell Padding different from Cell Spacing?

How is Cell Padding different from Cell Spacing?

1 Like

Answer :- Cell Spacing is the space or gap between two consecutive cells. Whereas, Cell Padding is the space or gap between the text/ content of the cell and the edge/ border of the cell. Please refer to the above figure example to find the difference

1 Like

Cell padding:

Cellpadding specifies the space between the border of a table cell and its contents (i.e) it defines the whitespace between the cell edge and the content of the cell.
Syntax:

< table cellpadding=“value” >…< /table > where, value determines the padding (space between the border of a table and its content)

Cell spacing:
Cellspacing specifies the space between cells (i.e) it defines the whitespace between the edges of the adjacent cells.

Syntax:

< table cellspacing=“value” >… where, value determines the padding (space between adjacent cells)

1 Like