Julia Briggs said:
I was looking for more of an intelligent response than the current
simple minded, non-thinking ones so far! This is a dynamic
presentation page -- so therefore how could you prevent a user from
deliberately entering a very long string that wouldn't break the
presentation page? (This is written in PHP by the way)
Julia, you are open for a flame you but I wont
This question comes up here at least one a month Yes, exactly the same
question and not only in this newsgroup but several others as well.
You can check this by looking at the archive over at
http://groups.google.com
In all cases the answer is the same. Tables are designed to expand to fit
their content. If that content (read non-wrappable text) is too wide for
your table then this is *your* problem. There is nothing in HTML to cause a
wrap, you can only cause truncation or introduce a horizontal scroll bar,
both with spasmodic browser support. If you don't believe this then go over
to the specifications and have a look. There is nothing that will cause a
string of characters to be wordwrapped at other than a space, or for some
browsers a -.
You are coding in PHP? Then you have direct control over those strings you
write to the HTML page. It is up to *you* to ensure that they do not cause
problems with your table, probably by inserting spaces at strategic points
in the string.
The fact that it is a user that entered the string is irrelevant, well maybe
not, users are a pain in the bum. However *you* have the string now. *You*
are writing the string to your HTML page. *You* make sure it does not screw
up *your* table.
Er, is that intelligent enough?
Cheers
Richard.