on-internet
← Community

What is the best way to break HTML text on slashes (/)?

Stack Overflow ·

I have an HTML table 360px wide, which works great. The challenge is that sometimes a url appears http://this/is/a/really-really-really-really-really/long/url in the text. This causes the table to expand horizontally and a scroll bar appears on the bottom. I don't think overflow:hidden will work because half of the text would be hidden. What is the best way to force breaking the line on slashes (/) and dashes (-) in CSS (hopefully)? It should work with IE7+, Chrome, Firefox and Safari. Working in Rails 3 and jQuery.

Comments

Sign in or sign up to comment and upvote.

No comments yet.