How to Wrap Text in an Html PRE tag
A CSS technique for Wrapping Preformated text in the PRE tag.
To force long text lines to wrap in an HTML <pre> tag, you can use CSS code to wrap the text. The word-wrapping CSS code below should work to wrap long lines of text within the <pre> tag, in IE, Firefox and Safari... you may want to test the browsers for yourself just to make sure though.
With that said, simply add the following snipet of CSS code to your main CSS file:
pre
{
overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */ /* width: 99%; */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}