Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wrap continuous text without spaces? [duplicate]

Tags:

css

Possible Duplicate:
CSS: How do I wrap text with no whitespace inside a <td>?

I have a line of text that is hundreds of characters long, and that I need to display on a page.

Because the line is continuous with no spaces, the browser won't wrap the text. My goal is to have the text wrap according to the size of the browser window.

Anyone know how to do this using CSS?

Example code:

<html>
<body>
 <table> <tr><td>
   mffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</td>      </tr></table>
</body>
</html>
like image 692
Praveena Avatar asked Dec 27 '11 10:12

Praveena


People also ask

How do you wrap text without space?

You can wrap a long string, which does not have any whitespace character by using the CSS word-wrap property, or overflow-wrap, if you use CSS3. In this snippet, you'll find some examples for block elements, as well as for the inline ones.

How do you break wrap text?

To insert a text wrapping break, put your cursor where you want the text to break, and go to Layout | Page Setup | Breaks, and select Text Wrapping. Now the text has dropped below the picture without using any superfluous paragraph breaks.

How do I stop text breaking in HTML?

To prevent the text from wrapping, you can use the CSS white-space property with the “nowrap” or “pre” value.

Can I use overflow-wrap?

You can use the CSS properties overflow-wrap and word-break to manage content overflow. However, there are differences in the way the two properties handle it. Using overflow-wrap will wrap the entire overflowing word to its line if it can fit in a single line without overflowing its container.


1 Answers

With this css

word-break: break-all;

you get what you want.

like image 184
Michel Ayres Avatar answered Nov 15 '22 17:11

Michel Ayres