This is what I have:
<td style='width:500px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;'>
This is what I have:
<td style='width:500px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;'>
This is what you want
I used:
table-layout: fixed
was the key to making it work.I think this solution will help you!
http://perishablepress.com/press/2010/06/01/wrapping-content/
// Edit
It's been a long time since this was accepted as the best answer and updates are required. See @benhowdle89's and @Steve's answers below.
So the current browser support is now good enough to use
word-break
in order to allow words to be broken over multiple lines.word-break: break-all
http://caniuse.com/#feat=word-break
All you need is
word-break:break-all
This works in Chrome 4+, IE 5.5+, FF 15+, Safari 3.1+, and Opera 15+