Close this window

Using the <preformat> tag

Description

The preformat tag is used to insert a line or block of pre-formatted text into a document. This can be useful for situations where explicit line breaks or character alignment is necessary.

Example

This CNXML:


<para id="fav-poem">
  When I was in first grade, my favorite 
  poem went something like this:
  <preformat id="pre-poem">
Roses are red
  Violets are blue
    Sugar is sweet
      And all girls have cooties!
  </preformat> 
</para>
        

Results in this display:

When I was in first grade, my favorite poem went something like this:
Roses are red
  Violets are blue
    Sugar is sweet
      And all girls have cooties!
  

Attributes(what's this?)

Children(what's this?)

title (one, optional), para, term, cite, cite-title, foreign, emphasis, sub, sup, code (block display only), preformat, quote, note, list, media (block display only), footnote, link, newline, space, definition, example, figure, table, rule, equation, exercise, Unicode text

Parents(what's this?)

content, section, para, preformat, quote, footnote, note, item, example, problem, solution, commentary, meaning, statement, proof, entry, title, label, cite, cite-title, link, emphasis, term, sub, sup, foreign, code, caption,
Close this window