How to break long words in a table td?

GuyFromOverThere picture GuyFromOverThere · Sep 2, 2011 · Viewed 24.9k times · Source

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;'>

Answer

Steve picture Steve · Jul 11, 2012

I used:

word-wrap: break-word;
word-break: break-all;
table-layout: fixed;

table-layout: fixed was the key to making it work.