how to force clipping or wrapping?

S

Steve

I just noticed a bug on my site where if someone enters a continuous string
of characters like
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

and I have that being rendered into a table with a width set to say.. 100,
it will stretch the table to fit all those characters. Enforcing characters
wouldn't really work cause the cell is allowed to wrap, they can enter a ton
of text if they want to, but when there are that many characters next to
each other... it breaks it. I know I could sit there and count characters
and watch for spaces and determine when something smells bad, but there must
be an easier way to do this.

I have tried explicitly setting the <td> to the desired width, that won't
stop it either.

Any ideas?

Steve
 
K

Kevin Spencer

I'm afraid the method you described ("sit there and count characters
....") is the only way.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
G

Guogang

A textarea with cols='50' may solve your problem.
Or style: STYLE="word-wrap:break-word;"
 
S

Steve

WOOHOO!!

That worked perfect! It only works in IE, but, to be honest...... for this
site I don't care.

Thanks for the tip!
<TD width="300" style="word-wrap:break-word">
 

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,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top