SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Grosseto, Italy
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    table placement problem

    hello, let's say I have an example table with two colomns and some text in both. like the below one
    Code:
    <table width="204" border="1" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td height="10" width="50%"><p>text1</p><p>&amp;nbsp;</p></td>
    <td height="10" width="50%"><p>text2</p><p>&amp;nbsp;</p></td>
    </tr></table>
    Whenever I add content in the right column and the table height increases, the text in the left column goes down.

    Example: If I add a paragraph in the right column:
    Code:
    <table width="204" border="1" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td height="10" width="50%"><p>text1</p><p>&amp;nbsp;</p></td>
    <td height="10" width="50%"><p>text2</p><p>&amp;nbsp;</p><p>&amp;nbsp;</p></td>
    </tr></table>
    the cotent in the left goes down.

    This is obvious, but is there anythig I can do to avoid the content in the left column to go down?
    I have this problem because I have dynamic content generated in the right column and therefore it is impossible for me to know the height of the table each time.

    thank you
    Last edited by tabsquare; Jul 7, 2002 at 14:33.

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
        <table width="204" border="1" cellspacing="0" cellpadding="0" align="center">
          <tr valign="top">  :D 
            <td height="10" width="50%"><p>text1</p><p>&nbsp;</p></td>
            <td height="10" width="50%"><p>text2</p><p>&nbsp;</p><p>&nbsp;</p></td>
          </tr>
        </table>

  3. #3
    Weird Little Girl Desdelena's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your table will always remain in the shape of a rectangle. As jofa suggested using the valign attribute should keep the text up at the top of the cells.

  4. #4
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have dynamic content generated in the right column and therefore it is impossible for me to know the height of the table each time
    No, not really...
    <div style="width:102px;height:200px;overflow:scroll;">
    Dynamic content, dynamic content , dynamic content...
    </div>

  5. #5
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Grosseto, Italy
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is perfect!
    still I have a lot to learn about HTML and CSS
    Thank you very much


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
  •