Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-05-2009
Member
 
Join Date: Feb 2009
Posts: 96
Cell Padding and Cell Spacing in HTML

I am a bit getting confused between these two attributes of HTML - tcell padding and cell spacing. Both are table attributes but I am totally confused which one means what ? Can anyone explain in simple language what each of these table attributes mean ?
Reply With Quote
  #2  
Old 14-05-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Cell Padding and Cell Spacing in HTML

Yes, both the definitions seems to be similar but they are diffrent.

The cellpadding attribute specifies the space between the cell wall and the cell content.

The cellspacing attribute specifies the space between cells.
Reply With Quote
  #3  
Old 14-05-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: Cell Padding and Cell Spacing in HTML

In HTML, the table tag has two properties - cellspacing and cellpadding.

Cellspacing - controls the space between table cells by defining the pixel width between them (controls the thickness of the border in other words).

Cellpadding - controls the amount of space between the contents of the cell (text, images, etc) from the cell wall (border).

The default for both properties is zero.

Example of a Cell Spacing -

< table border="1" cellspacing="5" >
< tr >
< td >some text< /td >
< td >some text< /td >
< /tr >< tr >
< td >some text< /td >
< td >some text< /td >
< /tr >
< /table >

It gives the following result -



Example of a Cell Padding -

< table border="1" cellpadding="10" >
< tr >
< td >some text< /td >
< td >some text< /td >
< /tr >< tr >
< td >some text< /td >
< td >some text< /td >
< /tr >
< /table >

It gives the following result -

Reply With Quote
  #4  
Old 14-05-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Cell Padding and Cell Spacing in HTML

The cellspacing attribute adjusts the space between the cells (intercell attribute) and cellpadding adjust the space within the cells(intracell attribute).
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Cell Padding and Cell Spacing in HTML"
Thread Thread Starter Forum Replies Last Post
Need help to adjust line spacing in a Cell of Excel Garsen's MS Office Support 2 16-02-2012 07:11 PM
How to restore cell gridlines lost after coloring the cell in Excel? Chitti's Windows Software 2 04-01-2012 06:54 PM
How can i divide a cell in a row in HTML ? Galeny Software Development 4 16-12-2009 10:36 PM
How to put background color for html cell Preetish Software Development 3 07-08-2009 03:32 PM
Auto-populate a MS Word table cell with text from a diff cell? dreamrthts Windows Software 5 23-03-2009 10:39 PM


All times are GMT +5.5. The time now is 01:31 AM.