SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Text in a table cell
-
Jul 28, 2006, 07:53 #1
- 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..
-
Jul 28, 2006, 11:03 #2
showing us whats happening might help...ie show us the table in question.
-
Jul 31, 2006, 06:37 #3
- 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
-
Jul 31, 2006, 12:46 #4
- Join Date
- Aug 2004
- Location
- Manchester UK
- Posts
- 13,807
- 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>
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
SpikeMike Swiffin - Community Team Advisor
Only a woman can read between the lines of a one word answer.....
Bookmarks