Vladimir
Vladimir

Reputation: 13153

Format long text string using css

I have logn string which doesn't fit into table cell. Actually string is a single long word.

Is it possible using css only to wrap such long word?

I have:

|klasdflksadjflsadkfj;lasdkfj;lsdkfjldskfjlsadkfj;lsdkfjklsajdf|

I want:

|klasdflksadjflsadkfj;lasdkfj;lsd|
|kfjldskfjlsadkfj;lsdkfjklsajdf  |

Upvotes: 1

Views: 1389

Answers (2)

warmanp
warmanp

Reputation: 809

You can use word-wrap:break-word according to caniuse.com this property has good browser support.

Upvotes: 0

Caspar Kleijne
Caspar Kleijne

Reputation: 21864

you need:

 word-wrap: break-word

in CSS3;

for a cross-browser solution you need to alter the text in the cell (with javascript) and add some breaks.

Upvotes: 3

Related Questions