Log in

View Full Version : Word wrap



onestopplay
07-13-2009, 08:35 PM
I have a long URL.
<a href='reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylonglink.html'>reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylonglink.html</a>
How do I word wrap it in a table cell? Thanks.

forum_amnesiac
07-14-2009, 06:51 AM
I found this style for you, either put it between <style> tags in the head of your HTML or even better put it in your CSS file, when tested it worked for me.


td.wrap

{
width: 300px;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */

}

Then refer to it as a class in your <td> line, ie


<td class="wrap">