| 1:57 pm on Aug 26, 2005 (gmt 0)|
I'm afraid you can't limit the width of tables or table columns where there are lines of unbreakable text.
One thing you can do is is place the table inside a <div style="height:600;width:800; overflow:auto"></div>. This will mean scrollbars appear in the div when the table expands - but will leave the width of your page unchanged.
| 7:19 pm on Aug 26, 2005 (gmt 0)|
I'll give this a try.
| 8:26 pm on Aug 26, 2005 (gmt 0)|
Thing is, the text has to go somewhere - either it is cut off and the overflow is invisible (which won't break your layout but will render the content useless), or you can force a scrollbar within a div as Iguana suggests (which is more functional but awkward), or you break your layout, or finally you ensure the text string can fit.
You say you are using PHP - you should be able to use PHP to check the length of the text or URL string in the database and transform it by adding, for example, a
<br> at appropriate points.
There is also a
<wbr> element which places a line break only when required, but it has been deprecated for a long while now and won't validate in HTML4/XHTML (and I will probably be shot down for suggesting it!).
| 1:30 am on Aug 27, 2005 (gmt 0)|
Thanks for the tips encyclo very insigtful
I have used the suggestion of Iguana and I now have it formatted to the best fitting format. Though, I would be interested in knowing how I can add <br> in the database as you suggested. Please keep in mind I use MySQL and this is "on the fly" content, which changes in real-time.
| 2:58 am on Sep 2, 2005 (gmt 0)|
I was wondering is it possible for me to wrap the text when it reaches a specified length, regardless if it breaks or not?
**Remember the content is being pulled from a MySQL database in real-time and being displayed.
If you know a way for me to complete this, please advise! Thanks.
| 12:37 pm on Sep 2, 2005 (gmt 0)|
You might want to post in our PHP forum [webmasterworld.com] for a more detailed (and perhaps more accurate!) reply, but you should look at using something like the wordwrap function: