SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Text in a table cell

    i have a table row consisting of 4 columns..

    i want teh first column to be fixed on resize hence the width is set as 200px
    the rest 3 are defined in % to enable resize..28% each.

    now on resize teh first cell holds its position till a point but then the browser overrides the setiing..

    how can i make this permanent or have the text in teh first column cell wrap ..

    thanks..

  2. #2
    Steve Benjamins tnrstudios's Avatar
    Join Date
    Jun 2003
    Location
    canada
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    showing us whats happening might help...ie show us the table in question.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks: here is the code for it..

    <div id="maintable" style="visibility:visible ; DISPLAY : block ">
    <table >
    <tr>
    <td style="width:150px; background-color: #777777"><a href="test.htm?toplevel=GSC&sublevel=sublinkname" onclick="showleft1();return false;"><font color="#3300FF">Global Service Center</font></a></td>
    <td style="width: 28%"><p align="center"><a style="text-decoration:none" href="test.htm?toplevel=houston&sublevel=sublinkname" onclick="showleft3();return false;">Houston SC</a></p></td>
    <td style="width: 28%"><p align="center"> <a style="text-decoration:none" href="test.htm?toplevel=Aberdeen&sublevel=sublinkname" onclick="showleft4();return false;">Aberdeen SC</a> </p></td>
    <td ><p align="center"> <a style="text-decoration:none" href="test.htm?toplevel=Stavanger&sublevel=sublinkname" onclick="showleft5();return false;">Stavanger SC</a></p></td>
    </tr>
    </table>
    </div>



    So when the page is resized . i.e minimized horizontally..
    the 2 nd , 3rd and 4th columns get resized .. the first column -width=150 px.
    holds its palce till a point .but after that the browser resizes this column too.

    how can I keep this column width constant. I dont mind the text in the columns being lost.

    Thanks

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    it is because the text will wrap underneath and allow the browser to control the dimentions.
    If you dont want this to happen you could use the "no wrap" function:
    HTML Code:
    <div id="maintable" style="visibility:visible ; DISPLAY : block ">
      <table >
        <tr>
          <td width="150px" nowrap="nowrap" bgcolor="#777777" ><a href="test.htm?toplevel=GSC&sublevel=sublinkname" onclick="showleft1();return false;"><font color="#3300FF">Global Service Center</font></a></td>
          <td width="28%"><p align="center"><a style="text-decoration:none" href="test.htm?toplevel=houston&sublevel=sublinkname" onclick="showleft3();return false;">Houston SC</a></p></td>
          <td width="28%"><p align="center"> <a style="text-decoration:none" href="test.htm?toplevel=Aberdeen&sublevel=sublinkname" onclick="showleft4();return false;">Aberdeen SC</a> </p></td>
          <td ><p align="center"> <a style="text-decoration:none" href="test.htm?toplevel=Stavanger&sublevel=sublinkname" onclick="showleft5();return false;">Stavanger SC</a></p></td>
        </tr>
      </table>
    </div>
    This is useful if the amount of text in the first cell isn't very long but can get messy if it is.

    It loks like you are using this for a navigation menu, if so you should really look at changing it to an inline <ul></ul> and use CSS to control the styling.

    Cheers

    Spike
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


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
  •