开发者

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 p开发者_开发知识库ossible using css only to wrap such long word?

I have:

|klasdflksadjflsadkfj;lasdkfj;lsdkfjldskfjlsadkfj;lsdkfjklsajdf|

I want:

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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜