tags:

views:

646

answers:

4

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.

textstring with space
textstring without space

+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
+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
If you want the collumn to wrap, you probably know how wide it should be.
Ikke
@Ikke: fair point!
Ben
If I give the width in percentages it doesn't work. Does it take only pix, em, pt?
Shivanand
@Shivanand: Yes, as far as I know you can't specify the width of a <p> in percentages.
Ben
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
A: 

hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

hjg
how hhhhhhhhhhelpful...
sscirrus