TD WIDTH
Moderator: General Moderators
TD WIDTH
Dear All,
I'm trying to get my TD elements to stick at a certain width - however because the TD is sometimes populated with text that is longer in pixel length than the stated WIDTH of the TD, the TD automatically resizes to fit the text. I don't want it to do this - rather I would like the text to be 'wrapped' around the size of the cell whilst the cell is kept at the stated width.
Is there any way of doing this?
Many thanks
Mark
I'm trying to get my TD elements to stick at a certain width - however because the TD is sometimes populated with text that is longer in pixel length than the stated WIDTH of the TD, the TD automatically resizes to fit the text. I don't want it to do this - rather I would like the text to be 'wrapped' around the size of the cell whilst the cell is kept at the stated width.
Is there any way of doing this?
Many thanks
Mark
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
- johnperkins21
- Forum Contributor
- Posts: 140
- Joined: Mon Oct 27, 2003 4:57 pm
Do you have an example of code that isn't working? This should work:
If you have one really really long string, like trying to put posting.php?mode=reply&t=23778 into a TD tthat isn't big enough for it, it may try to resize your TD on you. If all else fails try:
Code: Select all
<table width="200">
<tr>
<td width="100">A whole buttload of text... blah, blah</td>
<td width="100">A whole buttload more text... blah, blah</td>
</tr>
</table>Code: Select all
<table width="200">
<tr>
<td width="100" style="word-wrap: break-word;">A whole buttload of text... blah, blah</td>
<td width="100" style="word-wrap: break-word;">A whole buttload more text... blah, blah</td>
</tr>
</table>-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
I think thats what he meant with this.If you have one really really long string, like trying to put posting.php?mode=reply&t=23778
- johnperkins21
- Forum Contributor
- Posts: 140
- Joined: Mon Oct 27, 2003 4:57 pm
Ok, I just tested that whole style="word-wrap: break-word;" nonsense. It works in IE 6, but not in Firefox. Your next option is to use PHP, unless someone else knows of anything.
Try here: http://us4.php.net/wordwrap
Try here: http://us4.php.net/wordwrap