When I insert a continuous string of text in a fixed width "td", the text is not wrapping. Pls let me know why? Here are the links to the html pages.
+3
A:
You can add soft-hyphens: ­
.
Put them within the long word.
Have a look at it with this:
This­Texthasno­SpacesThis­Texthasno­Spaces­This­Texthasno­Spaces­ThisText­hasno­Spaces­This­Texthasno­Spaces
(deliberate over-use of ­
)
This is the hyphenator, you might find it helps.
dylanfm
2009-01-30 11:03:28
+2
A:
I wonder if this might help:
<p style="width: 100em; word-wrap: break-word">ThisTexthasnoSpacesThisTexthasnoSpacesThisTexthasnoSpacesThisTexthasnoSpacesThisTexthasnoSpaces</p>
Unfortunately, that requires you to know how wide you want your column to be.
Ben
2009-01-30 11:06:08
If you want the collumn to wrap, you probably know how wide it should be.
Ikke
2009-01-30 11:18:07
@Ikke: fair point!
Ben
2009-01-30 11:25:04
If I give the width in percentages it doesn't work. Does it take only pix, em, pt?
Shivanand
2009-01-30 13:49:11
@Shivanand: Yes, as far as I know you can't specify the width of a <p> in percentages.
Ben
2009-01-30 16:48:51
A:
You'll notice that a lot of popular sites (like Facebook) will insert a space in your word if you make it too long. It's the common solution, so don't be afraid of doing it.
Ray Hidayat
2009-01-30 11:18:51