Pre-formatted Text

Sometimes you don't want a block of text to be filled and justified like a paragraph. Sometimes you may want to keep all the spaces and returns exactly as they are, as in a table like this, where you want everything to properly display in columns:
Date         Holiday

Oct 31       Halloween
Dec 25       Christmas
Jan 1        New Year's Day

To do this use the <pre> </pre> tag.

This is the same text, without using the tag for pre-formatted text:

Date Holiday Oct 31 Halloween Dec 25 Christmas Jan 1 New Year's Day


Using pre-formatted text tags is an easy way to display large tables like the spreadsheet below:.

1995 Shipments From Southern Ports (tonnes)

FRUIT      Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec

Bananas     85   71  105   89   92  110   96   84   72   75   79   84
Grapes      17   19   16   11   12    9    8    9   12   14   17   16
Oranges    501  423  440  372  420  432  490  510  522  503  488  471
Figs         1    1    2    3    3    2    3    1    -    -    -    2
Dates        2    -    -    2    3    3    2    2    3    2    1    1
Lemons      11    8    9   10   11   13   11    9    8    7    6    9
Grapefruit 105   89   92  110   96   84   72   75   79   84   93  101

Using pre-formatted text is an easy way to display a table in HTML. Just insert a <pre> before the table text and a </pre> after it.

You should not use pre-formatted text all the time though. It may seem like an easy way to put text files onto the world wide web but when you view the page in a graphical browser (such as Netscape) the page will be in a different font and not look very good. It's more worthwhile to actually learn how to use html and then only use pre-formatted text when you have to.


Related Help Topics Search the Helpdesk Contacts (Support) Recent Changes VTN Home Page