PRE tag width not working with IE PLEASE HELP

I have a whole lot of text insdie  <pre width=80> ...</pre>

The problem is that IE, go figure, does not recognize the width setting.

Please help PLEASE!!
Who is Participating?
callrsConnect With a Mentor Commented:
Works in FF. Hmm.      The pre tag
"Also within <pre> ... </pre> long lines are no longer wrapped, they simple disappear out of the right hand side of the browser window although the browser horizontal scroll bar will usually reveal the text. "     HTML PRE TAG
"The "width" attribute of the pre element was deprecated in HTML 4.01.
The "width" attribute of the pre element is not supported in XHTML 1.0 Strict DTD."

callrsCommented:     Iconico - WebTools Pro
"Have you ever had to deal with continually scrolling left and right on a page? I've gotten so frustrated with the horizontal scrolling on newsgroup sites like, that I created this tool. The Wrap <Pre> Text function finds all preformatted text on a page, that is, text inside <Pre> tags, and makes sure that each line breaks at the edge of the window. You can now happily resize your window and just scroll vertically to read the newsgroups."
Julian MatzJoint ChairpersonCommented:
The deprecated width attribute of the <pre> tag tells the browser the expected line length of the preformatted block so that a suitable font size or margin can be used, however, in practice, browsers ignore this attribute.

The <pre> tag displays preformatted text, so it actually wouldn't make much sense to have a width attribute, in my opinion... Have you tried using css instead of the width attribute?

<pre style="width:300px;">your text...</pre>

I don't know if it will work, but it's worth a try...

You could also try using a <div> tag instead. I don't know why you need to use the <pre> tag, but if it's for monospace font lettering, you could also try the following:

<div style="font-family:monospace;width:300px;">Your text...</div>
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

pritaeasSoftware EngineerCommented:
You can use the Smarty template system to do this for you. You can set the line-length/wrapping the way you please. It will take care of displaying your text correctly.
If it's for a code listing, you might also consider the <code> tag (browsers should format this as monospace).
rpongAuthor Commented:
I was using the PRE tag to retain the spaced, returns, and tabs in the text.
I found that the PRE tag in IE doesn't know when to return except when the text says to. It'll keep running of the page.

I eventually just said F it and used the <textarea> tag and set the rows and collumns to the same dimmensions as the PRE tag.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.