Msg#: 10896 posted 1:04 pm on Aug 26, 2005 (gmt 0)
I'm not an HTML guru, I only know the basics. I use FrontPage to create my pages.
I have a .php page where I display member comments and entries. The content is stored in a MySQL database which I call upon to display the comments and entries. The problem is that sometimes a member will use a long URL or unbreakable text (e.g. abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwzyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz)
This long extended text will change the size of my table instead of staying formatted. This change will change the width of my page, where the bottom scrollbar will show and need to be moved to the right to see all the text. I would like for my table to stay static (my recommended width) no matter how long the URL or unbreakable text is. How can I accomplish this? Please advise. Thanks.
Msg#: 10896 posted 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.
Msg#: 10896 posted 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!).
Msg#: 10896 posted 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.