Results 1 to 4 of 4

Thread: Cell Padding and Cell Spacing in HTML

  1. #1
    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 ?

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    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 -


  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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).

Similar Threads

  1. Need help to adjust line spacing in a Cell of Excel
    By Garsen's in forum MS Office Support
    Replies: 2
    Last Post: 16-02-2012, 07:11 PM
  2. Replies: 2
    Last Post: 04-01-2012, 06:54 PM
  3. How can i divide a cell in a row in HTML ?
    By Galeny in forum Software Development
    Replies: 4
    Last Post: 16-12-2009, 10:36 PM
  4. How to put background color for html cell
    By Preetish in forum Software Development
    Replies: 3
    Last Post: 07-08-2009, 03:32 PM
  5. Auto-populate a MS Word table cell with text from a diff cell?
    By dreamrthts in forum Windows Software
    Replies: 5
    Last Post: 23-03-2009, 10:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,110,978.12802 seconds with 17 queries