Results 1 to 4 of 4

Thread: [RESOLVED] table image spacing

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Resolved [RESOLVED] table image spacing

    I have a table with an image and even though I set the table border, cell spacing, and cell padding to 0 the image still has vertical space below it.

    PHP Code:
    <table border="0" cellpadding="0" cellspacing="0">
        <
    tr>
            <
    td>
                <
    img src="image1.gif" />
            </
    td>
        </
    tr>
    </
    table
    When I add a second image below the first there is vertical spacing between them.

    PHP Code:
    <table border="0" cellpadding="0" cellspacing="0">
        <
    tr>
            <
    td>
                <
    img src="image1.gif" />
            </
    td>
        </
    tr>
        <
    tr>
            <
    td>
                <
    img src="image2.gif" />
            </
    td>
        </
    tr>
    </
    table
    How can I prevent this?

  2. #2
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: table image spacing

    wey97:

    I think you need to put your Border tag inside the Img tag.

    <img src="image1.gif" />

    <img src ="image1.gif" Border = 0 />

    I'm not sure, but I think this will work.

  3. #3
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: table image spacing

    I think you've encountered one of the things I love about IE - it's propensity to add additional whitespace to the rendered page.

    Try removing ALL whitespace from between the html tags and see if that doesn't resolve your problem - i.e, change

    PHP Code:
    <table border="0" cellpadding="0" cellspacing="0"
        <
    tr
            <
    td
                <
    img src="image1.gif" /> 
            </
    td
        </
    tr
    </
    table
    to

    PHP Code:
    <table border="0" cellpadding="0" cellspacing="0"><tr><td><img src="image1.gif" /></td></tr></table
    What bug? That's not a bug. It's an undocumented feature!

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: table image spacing

    Seemed to be just the whitespace between the <td></td>
    PHP Code:
    <table border="0" cellpadding="0" cellspacing="0">
        <
    tr>
            <
    td><img src="image1.gif" /></td>
        </
    tr>
    </
    table

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width