SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Technically, a bit dim macdan's Avatar
    Join Date
    Feb 2001
    Location
    London
    Posts
    344
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    An embarrasing low point with tables

    I really should know better but it's late and my brain has turned to mush.

    I want to stretch a lefthand coloured border so it is always the total length of the page irrespective of the browser/setup, a precis of my code is:

    <table>
    <tr>
    <td colspan="2"><table><tr><td>content</td></tr></table></td>
    </tr>
    <tr>
    <td><table bgcolor="#3399cc"><tr><td>leftborder content></td></tr></table></td>
    <td><table><tr><td>mainbody content</td></tr></table></td>
    </tr>
    </table>

    I'm nesting because there is a lot of content. Because of this, the leftborder content (and hence background colour) sits at the top of the page irrespective of the length of the main body content which is longer.

    How do I stretch the left border content to match that of the main body content? Unforunately I don't have the option of setting the main nest table background to that colour.

    Hope this makes some sense - thanks for any help.
    gorillaweb is a small London based digital design agency.

  2. #2
    :) delemtri's Avatar
    Join Date
    Jun 2001
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What I would do is,

    <table width=100%>
    <tr>
    <td colspan="2"><table><tr><td>content</td></tr></table></td>
    </tr>
    <tr>
    <td width=50%><table bgcolor="#3399cc"><tr><td>leftborder content></td></tr></table></td>
    <td><table><tr><td width=50%>mainbody content</td></tr></table></td>
    </tr>
    </table>

    I think that should be what you want. Not sure though.

  3. #3
    Technically, a bit dim macdan's Avatar
    Join Date
    Feb 2001
    Location
    London
    Posts
    344
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks but it's actually the length of the table which is the issue. I'm trying to get the length of the left border to stretch to the length of the main body.
    gorillaweb is a small London based digital design agency.

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By length do you mean height?

    If so, then use CSS:

    "your element" {height: 99%; }

    The reason why I didn't use 100% is because browser measure the height from the TOP left corner of the element. So if I position even a 1 pixel tall element at 100% from the top, it will position the element itself off the page and give you horizontal scrollbars all the time.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    Technically, a bit dim macdan's Avatar
    Join Date
    Feb 2001
    Location
    London
    Posts
    344
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks Creole I'll give that a try.
    gorillaweb is a small London based digital design agency.


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
  •