29

What is the difference between cell spacing and cell padding?

Community
  • 1
  • 1
Explorer
  • 301
  • 1
  • 3
  • 4
  • 2
    try difference between cell spacing and cell padding on google.com – Pranav Mar 20 '13 at 07:27
  • cellspacing is the space between the cell wall and cell padding expand the cell wall not give space – Vikas Gautam Mar 20 '13 at 07:28
  • 3
    Easy to illustrate: http://jsfiddle.net/QWRM6/ – dfsq Mar 20 '13 at 07:32
  • 2
    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? – CigarDoug Nov 08 '17 at 12:22
  • 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 http://www.digizol.com/2008/08/cellspacing-vs-cellpadding-table.html – lkamal Nov 13 '17 at 19:54
  • Related post - [Set cellpadding and cellspacing in CSS?](https://stackoverflow.com/q/339923/465053) – RBT Mar 19 '21 at 11:58

5 Answers5

47

This is the simple answer I can give.

enter image description here

Nayana Adassuriya
  • 23,596
  • 30
  • 104
  • 147
34

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.

Community
  • 1
  • 1
Sahil Popli
  • 1,967
  • 14
  • 21
2

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

Rohit Azad Malik
  • 31,410
  • 17
  • 69
  • 97
2

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.

Sanober Malik
  • 2,765
  • 23
  • 30
0

Cell spacing and margin is the space between cells.

Cell padding is space inside cells, between the cell border (even if invisible) and the cell content, such as text.

Dai
  • 141,631
  • 28
  • 261
  • 374