The PRE (Preformatted Text) element lets you include preformatted text in Web pages. Unlike in other HTML elements, all spaces and hard returns nested in a PRE element are displayed, rather than ignored. Text inserted in a PRE element is displayed in a monospaced (fixed-pitch) font (generally, Courier New). The example file contains a tabular arrangement of egg classifications and weights, formatted using spaces and returns. Use the PRE element to display it as it appears in a browser (see Figure 3.24):
<p>The size or weight class of a carton of eggs refers to the minimum weight per dozen. Size and quality are not related. The following table shows the different egg weight classes:</p><!--Start preformatted text<pre> Weight Class Minimum Weight Jumbo 30 oz. Extra Large 27 oz. Large 24 oz. Medium 21 oz. Small 18 oz. Peewee 15 oz. </pre>End preformatted text-->
Tip |
Using the PRE element, you can easily include worksheets exported from many spread-sheets in your HTML documents. Just export your document as a "print" file (or PRN file, with a .prn extension) and then copy and paste it into your HTML document. In Microsoft Excel, select File, Save As, and Formatted Text (Space delimited) (*.prn), to export a PRN file. The PRN format originated in Lotus 1-2-3, back when worksheets often had to be carried, via sneakernet, to be printed on another computer. |