Click to See Complete Forum and Search --> : In <TD> certain length/max length then force <BR>
ISMAILC
11-05-2008, 08:01 AM
Hi, I need help please.
In <TD> certain length/max length then force <BR>
I would like within a <TD> to allow certain amount of char and then force a <br>.
Is this possible, Please Assist!
Regards
http://www.webdeveloper.com/forum/showthread.php?t=194223
ISMAILC
11-05-2008, 12:44 PM
Hi, I guess what I'm looking for is text wrap or word wrap.
I have 2 columns with one being string build on user selection and the second column an image. When the string is long the column increases over the image. I want to text wrap/word wrap so that the text goes to a new line <br> - even a certain amount of char then <br>
Thank you for taking time to help!
felgall
11-05-2008, 12:51 PM
The text will wrap automatically at the width of the <td> unless there is a single word in the text is to long to fit in the width in which case the <td> will be made wider to fit that word. The only way to fix that is to fix the word causing the problem so that you don't have any words longer than the width of the <td>
ISMAILC
11-05-2008, 01:32 PM
The problem is that the string is build on user selection - with aboout 10 different options to select. That's i wanted to have a <br> after certain amount of char.
Thanks
felgall
11-05-2008, 02:56 PM
So make the <td> wide enough to hold any of the 10 options and then there will be no need to wrap it.
savvykms
11-08-2008, 08:11 PM
Suggestion: use a <textarea> element to do this for you. Plcae it inside the <td>.
<textarea border="0" height="100%" disabled>text</texarea>
This should take up 100% of the <td> (if it is alone within the <td>) and have no border etc... the <td> if nothing is influencing it, should be the perfect size for the text and word-wrap text. There is a way to disable scrollbars in CSS I think. You can read up on it if you want.
I may be wrong, as I did not test the above, but it will probably work. Note that no CSS is used.