How do I prevent this from happening? (long text pushing out a fixed frame)

J

Julia Briggs

Hello! If I have something like this for example,

<table border="1" cellpadding="0" cellspacing="0" valign="top"
width="250">
<tr><td>LongUnbrokenWordLongUnbrokenWordLongUnbrokenWord</td></tr>
</table>

How can I force the text inside the <td> to break at the specificed
width without pushing the table out?
 
B

brucie

<tr><td>LongUnbrokenWordLongUnbrokenWordLongUnbrokenWord</td></tr>
How can I force

you can never force
the text inside the <td> to break at the specificed width without
pushing the table out?

theres a few different methods but the way to solve the problem is not
to have it in the first place. you're trying to fix the wrong problem.
don't have a string of text so long without spaces in the first place so
the text can wrap like its supposed to. simple.
 
D

Duende

While sitting in a puddle brucie scribbled in the mud:
theres a few different methods but the way to solve the problem is not
to have it in the first place. you're trying to fix the wrong problem.
don't have a string of text so long without spaces in the first place so
the text can wrap like its supposed to. simple.

Perhaps it's a site written in Sanskrit. :)
 
C

chris

Julia Briggs said:
Hello! If I have something like this for example,

<table border="1" cellpadding="0" cellspacing="0" valign="top"
width="250">
<tr><td>LongUnbrokenWordLongUnbrokenWordLongUnbrokenWord</td></tr>
</table>

How can I force the text inside the <td> to break at the specificed
width without pushing the table out?

php would help.
 
J

Julia Briggs

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)

Thx!

Julia
 
B

brucie

I was looking for more of an intelligent response than the current
simple minded, non-thinking ones so far!

they were intelligent responses, your failure to recognize them as such
demonstrates your level of intelligence.
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?

don't you think it would have been a good idea to supply all the
relevant details in the first place instead of hoping peoples crystal
balls would supply the details for them?
(This is written in PHP by the way)

php can solve the issue easily, i would tell you exactly how and supply
a demo but you've pissed me off.

have a nice day
 
R

rf

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.
 
A

Andy Hassall

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 -.

Although there are 'discretionary hyphens' ( &shy; ) that you could place at
regular intervals in long strings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top