javascript - Wrap text in td without breaking the word -


i have issue in word wrapping in css. have td have defined width 300px. have url inside td

http://www.abc.com/testing/testdata/testurl/test/testing.html 

when use word-wrap: break-word, text wrapping

http://www.abc.com/testing/testdata/tes turl/test/testing.html 

but want word break. /tes in 1 line , turl in line. want as,

 http://www.abc.com/testing/testdata/testurl/  test/testing.html 

kindly help. appreciated. thanks.

updated:

i have probability of getting text other url. means can't relay on '/' in data. can use javascript not jquery.

i can't think of css-only solution. using javascript add word break opportunity tag <wbr>. tells browser - except internet explorer - can insert breaks:

javascript (using jquery)

$('#element').html( $('#element').html().replace(/\//g, '/<wbr>') ); 

demo

http://jsfiddle.net/ekfur/

as of edit

you edited question while writing fiddle. can of course use character / used in expression replaced <wbr>-tag.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -