Archive for March, 2010

How to Use Preformatted Text

March 5th, 2010 Computer Eucation No comments

Preformatted text allows you break away from the normal rules of HTML and quickly specify exactly how a section of text will appear in the reader’s Web browser. When you’re using preformatted text, you don’t need to use the HTML markup tags-the text will appear exactly as you’ve typed it, complete with spaces, line breaks, and empty lines. Preformatted text is always displayed in a monospaced, fixed-width font.

Tip Sheet

  1. Preformatted text is a great way to create a quick and dirty table of data, such as names and phone numbers. However, HTML 3.2 has full table support, and in most cases you’ll want to use real tables whenever possible. Another good use for the <PRE> and </PRE> tags is to display samples of Internet e-mail or newsgroup posts in your HTML document. These messages often have specific layouts that are difficult to reproduce in straight HTML. Just cut and paste the original message into Notepad and then place the <PRE> and </PRE> tags at the beginning and end, respectively.
  2. To begin a section of preformatted text, type <PRE>.
  3. Now type the section of text exactly how you want it to appear. It’s a good idea to limit the length of your lines to 65 characters or less, so that you can accommodate the screen width of most browsers. (Remember that browsers will not word wrap preformatted text.)
  4. When you’re finished entering your preformatted text, type </PRE> to mark the end of the section.
  5. You can apply character formatting styles, such as bold and italic, in preformatted text. Headings and paragraphs will not work in preformatted text blocks, however.
Categories: Formatting Text Tags: