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

Tags: , ,

Sponsored Links



Cell Padding and Cell Spacing in HTML

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 14-05-2009
Member
 
Join Date: Feb 2009
Posts: 87
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
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
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
opaper's Avatar
Member
 
Join Date: May 2008
Posts: 2,362
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
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
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


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
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 04:32 PM
how to get voicemail from cell phone without cell Kurtz Portable Devices 3 30-06-2009 08:40 PM
Auto-populate a MS Word table cell with text from a diff cell? dreamrthts Windows Software 5 23-03-2009 11:39 PM


All times are GMT +5.5. The time now is 03:40 AM.