HTML Document Conversion: Text Format Types

Displaying Text in the HTML Environment


There are many ways to format an HTML document. The text may be displayed, under current HTML standards, in one of three modes:

Normal
Pre-Formatted
Listing
Each of these three modes can be used throughout a single document, but only one mode may be used at a time. Each mode has advantages and limitation associated with it. Here is a brief synopsis of those distinguishing features. If you wish a more in-depth look into Hyper-Text formatting, please see the NCSA Language and style Guides for HTML, or click HERE for a Beginner's Guide to HTML.

Normal:

Normal is the default text setting. It automatically wraps when it comes to an end of line, and it also automatically adjusts to fit your viewer's window when it is resized. Spaces, new lines, and tabs have no effect in this style. Only one space will be recognized, while additional spaces and tabs are ignored. Thus, code written as:

Time    Place           Name    Amount
----    -----           ----    -------
12:00   Here            Bob     $12.05           
 1:00   There           John    $ 1.50
 3:00   Anywhere        Anne    $52.75

Will display as:

Time Place Name Amount ---- ----- ---- ------- 12:00 Here Bob $12.05 1:00 There John $ 1.50 3:00 Anywhere Anne $52.75

All HTML special codes are recognized here, so one must beware of using the HTML Special Characters ( < , > , and & ). It is very difficult, if not impossible to format text using this style. For that reason, Pre and Listing were developed.


Pre-Format:

Use the pre tag (which stands for ``preformatted'') to include text in a fixed-width font and to cause spaces, new lines, and tabs to be significant. Hypertext references (and other HTML tags) can be used within < pre > sections, so you can include links and graphics. This also means that you must be careful of Special Characters ( < , > , and & ). Pre will not wrap at new lines and will not resize to your screen. It will recognize new lines, tabs, and spaces. Thus, code written as:

< PRE >
Time	Place		Name	Amount
----	-----		----	-------
12:00	Here		Bob	$12.05
 1:00	There		John	$ 1.50
 3:00	Anywhere	Anne	$52.75
< /PRE >

Will display as:
Time    Place           Name    Amount
----    -----           ----    -------
12:00   Here            Bob     $12.05           
 1:00   There           John    $ 1.50
 3:00   Anywhere        Anne    $52.75

Pre is especially useful if displaying columns or "saved-with-format" text, as long as there are NO un-intentional special characters in them. You may want to do a quick text-search of the documents before using PRE.

Listing:

Netscape, Mosaic, and other browsers use this tag differently. Use PRE instead.

You must choose which format, or combination of formats, will serve your document best. One last consideration should be made to document congruity. A mix and match of these different types, because of their display and font differences, may or may-not suit your particular document.

Last updated on: Thu Jun 15 12:06:00 PDT 1995