<PRE ...>

Usage Recommendation
thumbs up use it

<PRE ...> is one the handiest tags in the HTML toolbox. <PRE ...> marks the text as "preformatted" -- all the spaces and carriage returns are rendered exactly as you type them.

<PRE>
title            extension
Raha         Producer         8765
Kathy        Accountant       8924
Scarlett     Security Guard   8273
</PRE>

produces

title            extension
Raha         Producer         8765
Kathy        Accountant       8924
Scarlett     Security Guard   8273

<PRE ...> text is rendered in a fixed width font, meaning that all characters and spaces are the same width. Fixed width makes it easy to lay out the text just the way you want it, so <PRE ...> is great for creating "quick and dirty" tables like the one above.

<PRE ...> does NOT cause the browser to ignore tags. You can still create links and other goodies:

<PRE>
title             extension
<A HREF="raha.html"    >Raha</A>         Producer          8765
<A HREF="kathy.html"   >Kathy</A>        Accountant        8924
<A HREF="scarlett.html">Scarlett</A>     Security Guard    8273
</PRE>

produces

title             extension
Raha         Producer          8765
Kathy        Accountant        8924
Scarlett     Security Guard    8273

When you start adding markup, it gets harder to see how the text turns out (spacing your tags out evenly like the table above helps). <PRE ...> is often used to quote large blocks of text that you don't want to "HTMLize", but a < or > could mess up the text. For a table larger than a few lines, it is usually easier in the long run to use table code.





About the Author
Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.