SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jan 2001
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is it just me or does this not compute?

    All right:

    Heres the code in question:

    <table width="100%" border="5" cellspacing="0" cellpadding="0">
    <tr>
    <td height="60" colspan="5" background="../graphx/ppixel.gif"></td>
    </tr>
    <tr>
    <td width="15" height="5" colspan="2"><img src="../graphx/a2.gif" width="15" height="5"></td>
    <td height="5"><img src="../graphx/wpixel.gif" width="1" height="1"></td>
    <td width="15" height="5" colspan="2"><img src="../graphx/h2.gif" width="15" height="5"></td>
    </tr>
    <tr>
    <td width="10" background="../graphx/ppixel.gif"><img src="../graphx/ppixel.gif" width="1" height="1"></td>
    <td colspan="3">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td width="10"><img src="../graphx/wpixel.gif" width="1" height="1"></td>
    <td>&nbsp;</td>
    <td width="10"><img src="../graphx/wpixel.gif" width="1" height="1"></td>
    </tr>
    </table>
    </td>
    <td width="10" background="../graphx/ppixel.gif"><img src="../graphx/ppixel.gif" width="1" height="1"></td>
    </tr>
    <tr>
    <td width="15" height="5" colspan="2"><img src="../graphx/a3.gif" width="15" height="5"></td>
    <td height="5"><img src="../graphx/wpixel.gif" width="1" height="1"></td>
    <td width="15" height="5" colspan="2"><img src="../graphx/h3.gif" width="15" height="5"></td>
    </tr>
    <tr>
    <td height="60" colspan="5" background="../graphx/ppixel.gif"></td>
    </tr>
    </table>

    I apologize for posting all the markup.

    Now, the areas in bold are the parts in question. It doesn't display with those cells 15 pixels wide and with the next cell taking up the majority of the width of the page follwed by the last cell like I'd like it too. Instead, it (the first cell) takes about half of the page, followed the next cell which takes up about the same, and finally the last cell which is identical to the first yet displays correctly 15 pixels wide. I cannot get the first cells to only display 15 pixels wide. If there's a bug in here, I would really appreciate any solutions you may find. Thanks in advance.
    -Colin Anderson
    http://www.htmletc.net/
    There are two ways to write
    error free code. Only the third
    one works.

  2. #2
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay. it is very crucial that you specify a width for every <td>
    you can do it in percent or pixels..but specify them.

    you should not encounter this problem if you set the width.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  3. #3
    SitePoint Zealot honging's Avatar
    Join Date
    Jan 2001
    Location
    Chapel Hill, NC
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dah. yeah, follow what lyon said above; try to set widths for all cells.

    but as a general note, try to not use so many colspans

    I noticed that a lot of browsers (especially NS 4.x) have trouble reading colspans sometimes, especially when you start nesting tables.

    I would use separate tables instead (one table for a straight horizontal area, another with 3 columns... etc. etc)

  4. #4
    busy Steelsun's Avatar
    Join Date
    Mar 2001
    Location
    Houston, Tejas; Future Capital of the World
    Posts
    2,474
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What the others said above sounds right.

    Also, as a default width for where you have none, try using 100%.
    Colspans do end up screwing up the widths of other cols , so avoid them if possible.
    Brian Poirier
    SunStockPhoto: Stock Photos, Fine Art Photos, Event Photography

  5. #5
    SitePoint Member
    Join Date
    Jan 2001
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many thanks Lyon, Honging, and Steelsun. I appreciate it -- the problem has been fixed. Having others solve my simple problems while I work on the hard ones is a big help! Perhaps I'll get to repay you by helping you out on a problem? =) Oh well, back to PHP!
    -Colin Anderson
    http://www.htmletc.net/
    There are two ways to write
    error free code. Only the third
    one works.


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
  •