Html: Difference between cell spacing and cell padding

152,006

Solution 1

This is the simple answer I can give.

enter image description here

Solution 2

cellspacing and cell padding


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.

Solution 3

CellSpacing as the name suggests it is the Space between the Adjacent cells and CellPadding on the other hand means the padding around the cell content.

Solution 4

Cellpadding is the amount of space between the outer edges of the table cell and the content of the cell.

Cellspacing is the amount of space in between the individual table cells.

More Details *Link 1*

Link 2

Link 3

Share:
152,006

Related videos on Youtube

Explorer
Author by

Explorer

Updated on November 23, 2020

Comments

  • Explorer
    Explorer over 3 years

    What is the difference between cell spacing and cell padding?

    • Pranav
      Pranav about 11 years
      try difference between cell spacing and cell padding on google.com
    • Vikas Gautam
      Vikas Gautam about 11 years
      cellspacing is the space between the cell wall and cell padding expand the cell wall not give space
    • dfsq
      dfsq about 11 years
      Easy to illustrate: jsfiddle.net/QWRM6
    • CigarDoug
      CigarDoug over 6 years
      Funny thing, this is now the highlighted answer on google. I needed to remind myself of the difference. I googled it. This was the highlighted answer on google, and it answered my question. So, why isn't it a valid question?
    • lkamal
      lkamal over 6 years
      cellspacing : space between cells; cellpadding : space between the cell border and it's content. So try to think about cellspacing as "cell-spacing or space between cells". But cellpadding is "how much padding is added inside the cell to limit the space left for text inside". For a quick demo with HTML code, have a look at here digizol.com/2008/08/cellspacing-vs-cellpadding-table.html
    • RBT
      RBT about 3 years
  • Grijesh Chauhan
    Grijesh Chauhan about 10 years
    So is there any difference between Cellspacing and margin of cell.