SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    New York city
    Posts
    212
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    unwanted space between tables

    on my site www.thevoiceworkshop.com there seems to be some unwanted space between table.toplinks which has my horizontal links and table.chief which has two cells, a left cell with more links and a right cell with content. Is there some way to remove this space? The style sheet is www.thevoiceworkshop.com/VWSmaster1.css

    thanks
    Jerry

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So far as I can tell, the space is caused by the cellspacing="2" attribute in table.chief. It's not your CSS.

  3. #3
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    New York city
    Posts
    212
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by greg.harvey
    So far as I can tell, the space is caused by the cellspacing="2" attribute in table.chief. It's not your CSS.
    I thought that was just to space the two cells in table.chief. This affects the space between the two tables?

  4. #4
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes. Cellspacing puts a defined pixel space around all sides of all affected cells, including the top. That's your problem so far as I can tell.

    Edit:

    If you use CSS to do your spacing and padding then you can specify the sides to apply it to, so you can leave the top and left as 0.

  5. #5
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    New York city
    Posts
    212
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by greg.harvey
    Yes. Cellspacing puts a defined pixel space around all sides of all affected cells, including the top. That's your problem so far as I can tell.

    Edit:

    If you use CSS to do your spacing and padding then you can specify the sides to apply it to, so you can leave the top and left as 0.
    Thanks for the info. I'll give it a try when I get home from work.

  6. #6
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No probs. Try getting the desired effect by messing with this CSS in table.chief:

    Code:
    	padding-top: 0px;
    	padding-right: 2px;
    	padding-bottom: 0px;
    	padding-left: 0px;
    	margin-top: 0px;
    	margin-right: 2px;
    	margin-bottom: 0px;
    	margin-left: 0px;

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by greg.harvey
    No probs. Try getting the desired effect by messing with this CSS in table.chief:

    Code:
    	padding-top: 0px;
    	padding-right: 2px;
    	padding-bottom: 0px;
    	padding-left: 0px;
    	margin-top: 0px;
    	margin-right: 2px;
    	margin-bottom: 0px;
    	margin-left: 0px;
    Or for a more efficient method, use CSS shorthand:
    Code:
    padding: 0 2px 0 0;
    margin: 0 2px 0 0;
    Greg's code will work, but it's pretty verbose .

  8. #8
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I like verbose! Ok... my bad...

  9. #9
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by greg.harvey
    I like verbose! Ok... my bad...
    It's okay, you're still cool with me

  10. #10
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    New York city
    Posts
    212
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Greg and Vinnie,

    Just to let you guys know your suggestions worked. Just removing the cellspacing tag did not work but setting it = "0" did?????? Shouldn't remoing the tag work just as well?

    In any case, thanks for all your help

    Jerry

  11. #11
    SitePoint Wizard Crowe's Avatar
    Join Date
    Nov 2001
    Location
    Huntsville
    Posts
    1,117
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jerrynyc
    Hi Greg and Vinnie,

    Just to let you guys know your suggestions worked. Just removing the cellspacing tag did not work but setting it = "0" did?????? Shouldn't remoing the tag work just as well?

    In any case, thanks for all your help

    Jerry
    Removing the tag sets it to "default". Most browsers render a table with at least a '1' as the default spacing. You have to specify '0' if you want '0'. Same goes for border.

    Greg, Vinnie
    As for Verbose vs. Shorthand I'll take shorthand. If you serve a million pages a month, think of the bandwidth you'll save!
    Chrispian H. Burks
    Nothing To Say

  12. #12
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Crowe
    As for Verbose vs. Shorthand I'll take shorthand. If you serve a million pages a month, think of the bandwidth you'll save!
    Ditto - makes it much easier to read IMO, and also means your style sheets aren't like 3000 lines long

  13. #13
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, ok, I've been told!! Jeez....

  14. #14
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Crowe
    Removing the tag sets it to "default". Most browsers render a table with at least a '1' as the default spacing. You have to specify '0' if you want '0'. Same goes for border.
    Sort of. What you're actually seeing when you don't define "cellspacing=0" in your HTML is the table borders not collapsing. If you add this into your CSS in the relevant spot:
    Code:
    border-collapse: collapse;
    You won't see that border spacing, and your table will act like it has cellspacing of 0, and you won't have to redefine cell spacing in your HTML.

  15. #15
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by platinum
    Ditto - makes it much easier to read IMO, and also means your style sheets aren't like 3000 lines long
    I mix and match. Usually if I only need one or two directions padded/margined, I'll probably use margin-right, padding-left, etc. and not define the other sides. If I need three or four, I'll use shorthand.

  16. #16
    SitePoint Addict
    Join Date
    Mar 2003
    Location
    New York city
    Posts
    212
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the info Vinnie however I have already went ahead and changed cellspacing ="0" but I'll keep it in mind for the future.

    Jerry


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
  •