Cell Width

liunx

Guest
When I type in <br />
<br />
<td width=100>testtesttesttesttesttesttest</td><br />
<br />
<br />
, the text does not wrap around. Instead, the text makes the cell with larger than 100 pixels. How do I make the text wrap and the cell width = 100 pixels?<!--content-->that is becaseu teh text doesn't have any breaks in it. the table will not break a continuous string.<!--content-->LOL... that one used to get me all the time! <br />
<br />
try this....<br />
<br />
<td width=100>test test test test test test test</td><!--content-->ah, yes. the spaces worked. :)<!--content-->What do I do if I want<br />
<br />
1.) Left cell and right cell to fill the rest of the area<br />
2.) Middle cell always to be 750 pixels<br />
<br />
<br />
_______________________________<br />
| Internet Explorer |_|U|X|<br />
-------------------------------<br />
| | | | <br />
| | | |<br />
|<-100%->| |<-100%->|<br />
| | <-750 p.-> | |<br />
| | | |<br />
| | | |<br />
-------------------------------<br />
<br />
<br />
Doing this <br />
<td width=100%></td><br />
<td width=750>a</td><br />
<td width=100%></td><br />
didn't work.<!--content-->that didn't work why?<br />
<br />
ok so you have 750 for the middle one, and the screen is actually 790 something so you have to do some math to get the other 2 cells the desired width.<br />
<br />
say 750 is 3/4 of the screen, well a little more than that but we can do this. make the other 2 cells about 10% instead. you will have to play with the percentages to get it just right and remember it will be different if the user has 1024x768<!--content-->I want the left and right side to fill the whole screen. putting 10% didn't make them fill the whole screen. <br />
<br />
Another problem arised. When I shrunk my window too much, the middle cell became less than 750. Man! This is my biggest concern. I want the middle to be ALWAYS 750. I could put in a image that takes up 750 pixels, but isn't there a better way?<!--content-->how can you have the left and right fill the whole screen when the middle is doing just that?<br />
<br />
I said you would have to fiddle with the 10% and make it as big as you would need.<br />
<br />
what is the code you have so far?<!--content-->If you specify: <td width=100%></td> then you are saying the table cell occupies the whole screen width. So, how can you have two of those and expect it to work.<br />
<br />
You need to make the <table> width "100%" first. You can easily fix the table data cell width to 750 pixels by using a 1x1 transparent gif and stretching it with a width attribute.<br />
<br />
What does "40%" -- "750" -- "40%" do for you? That may work a bit better.<!--content-->Giz's suggestion did the trick. I now have...<br />
<br />
<br />
<table width=100% border=1><br />
<tr><br />
<td></td><br />
<td width=750><br />
<img src=http://www.htmlforums.com/archive/index.php/"space.gif" width=750 height=1><br />
hello<br />
</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<br />
His image stretching trick works as well. It is ingenious as well. I have to ad one thing. I don't even have to make a transparent gif or any other image as well. Because HTML automatically puts in a x in the place of a nonexistent image.<!--content-->:mad: <br />
<br />
what ever.<!--content-->
 
Back
Top