SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    stacked table - weird gap

    Hi guys I am trying to put two tables one ontop of each other however I am getting maybe a 1-2pixel gap when my background image is applied to both rows. For example:

    HTML Code:
    <table width="97&#37;" border="0" cellspacing="15">
      <tr>
        <td background="bg">&nbsp;</td>
      </tr>
    </table>
    <--- GAP APPEARS HERE IN LAYOUT
    HTML Code:
    <table width="97%" border="0" cellspacing="15">
      <tr>
        <td background="bg">&nbsp;</td>
      </tr>
    </table>
    I have tried styling through .css but it makes no difference and I suck at doing tableless layouts, just too many variables for little ole me so take in. Can anyone advise a setting which may work?

  2. #2
    SitePoint Addict drjones013's Avatar
    Join Date
    Jan 2007
    Location
    Las Vegas, NV
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What have you tried in CSS? As an extreme last resort this should hack it:
    table {
    top-margin: -2px;
    }

    There should be a better way to fix it, though.

  3. #3
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try adding in the cellpadding=0 parameter.

    Code:
    <table width="97%" border="0" cellpadding="0" cellspacing="15" width="97%" >
         <tr>
         <td background="bg"></td>
         </tr>
    </table>

  4. #4
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should apply the background image via css. Is it to go only into the 2 cells or as a background to the table itself?

    Can you post a link to the page you are working on - it's better for people to try and help if they can see what you've tried....

    Nadia


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
  •