SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can I get rid of spaces between table cells? I've tried setting cellspacing, cellpadding, and border to 0 but still get blank spaces between the cells. I am trying to put a continuous background in a table. Is this where layering would be a better way to do it, and if so, how do I do that? TIA
    --Bill

    ------------------
    Lake Superior Smokin' Brews
    Make It Different: Brew Your Own!
    www.smokinbrews.com

  2. #2
    SitePoint Wizard
    Join Date
    Sep 1999
    Posts
    1,390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can specify the background in your table.

    To fix your problem though, make sure that your individual cells don't have borders.

    It would help to post a URL.

    ------------------
    Aidan Bahta
    abahta@flashmail.com

    ActiveWM.com - The place for the Active Webmaster.

  3. #3
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's an example of the spaces I'm trying to get rid of.
    www.smokinbrews.com/lsbrew2.html
    The graphic was originally one piece. I quartered it in PSP 6 (cut out a section and pasted it as a new image).
    Thanks
    --Bill

    ------------------
    Lake Superior Smokin' Brews
    Make It Different: Brew Your Own!
    www.smokinbrews.com

    [This message has been edited by Sahti (edited July 03, 2000).]

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Change your code to:

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    &lt;TABLE cellpadding="0" cellspacing="0" border="0"&gt;
    &lt;TR&gt;
    &lt;TD valign=bottom border="0"&gt;&lt;IMG SRC="lstl.gif" VSPACE=0 hspace="0"&gt;&lt;IMG SRC="lstr.gif" VSPACE=0 hspace="0"&gt;&lt;/TD&gt;
    &lt;/TR&gt;
    &lt;TR&gt;
    &lt;TD valign=top border"0"&gt;&lt;IMG SRC="lsbl.gif" VSPACE=0 hspace="0"&gt;&lt;IMG SRC="lsbr.gif" VSPACE=0 hspace="0"&gt;&lt;/TD&gt;
    &lt;/TR&gt;
    &lt;/TABLE&gt;

    [/code]

    I know it doesn't look to much differently but try it and see if it works. If it does, I'll explain why. Alsomake sure to add height and width tags to your images.

    ------------------
    Wayne Luke - Sitepoint Forums Administrator
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com

  5. #5
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    doh! I forgot to upload the image files. I changed the code and the images are lined up side by side, but between the rows there is still a gap. One other question that I think is sort of related (it has to do with table cells). Why is it that if I create an image that is say 100 x 100 pixels and put it into a 100 x 100 pixel table cell, the image seems to have about the last 5 pixels to the right cut off? The image I am working with on this page (www.smokinbrews.com/lsbrew2.html) seems to fit in properly, but I've tried to make some rounded rectangles to use for menu/border bars, and I have to make the table cells 5 to 10 pixels larger than the image I originally created to get it to fit. Thanks for your help.
    --Bill

    ------------------
    Lake Superior Smokin' Brews
    Make It Different: Brew Your Own!
    www.smokinbrews.com

  6. #6
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ok now now put your row tags (TR) on the same line as the same cells it contains.

    SO your code would look like:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    &lt;table attibutes... &gt;
    &lt;tr&gt;&lt;td&gt;&lt;img&gt;&lt;/td&gt;&lt;td&gt;&lt;img&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;&lt;img&gt;&lt;/td&gt;&lt;td&gt;&lt;img&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;/table&gt;
    [/code]

    I also removed all that formatting garbage from your &lt;TD&gt; tags because frankly its not needed and just gets in the way.

    The reason this works is the while HTML Agents (a.k.a Browsers) are supposed to ignore white space, they don't do it very well. They always accept the first space and newline/carriage return they see and render it. Technically browsers should only render what is within cells (TD) and use the rest of the information for formatting purposes. But they don't and each company is free to set their own rendering specifications.

    I hope this helps.


    ------------------
    Wayne Luke - Sitepoint Forums Administrator
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com

  7. #7
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Now after I start indenting and separting my table coding so that it's easier to read I have to stop doing it and mush everything together!
    --Bill

    ------------------
    Lake Superior Smokin' Brews
    Make It Different: Brew Your Own!
    www.smokinbrews.com

  8. #8
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Just make sure each row of data is on its online and you should be fine.

    Also you only have to do this if the spaces bother you. Normally they won't be a problem.

    ------------------
    Wayne Luke - Sitepoint Forums Administrator
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com


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
  •