what is the use of a "PRE" tag in (X)HTML
The <pre> tag defines preformatted text. Text in a <pre> element is displayed in a fixed-width font, and the text preserves both spaces and line breaks. The text will be displayed exactly as written in the HTML source code.
The <pre> tag in HTML is used to define the block of preformatted text which preserves the text spaces, line breaks, tabs, and other formatting characters which are ignored by web browsers.
It is used to demonstrate pre-formatted text, where new-line breaks are relevant. For instance, ascii art ;-) or program code. Well, for program code the CODE element is better.
It's for displaying data/code/art where you want all your spaces and newlines to be displayed as is, and want your columns to line up. So you can do stuff like this:
+-----+------------------+--------+------------+
| id | session_key | length | expires |
+-----+------------------+--------+------------+
| 263 | SNoCeBJsZkUegA7F | 86400 | 1257401198 |
| 264 | UoVm3SZRmPHnac4V | 86400 | 1257405561 |
| 262 | bjkIOWBhI1qxcrWr | 86400 | 1257401189 |
+-----+------------------+--------+------------+
without "pre" or "code" or some such, this looks like this:
+-----+------------------+--------+------------+ | id | session_key | length | expires | +-----+------------------+--------+------------+ | 263 | SNoCeBJsZkUegA7F | 86400 | 1257401198 | | 264 | UoVm3SZRmPHnac4V | 86400 | 1257405561 | | 262 | bjkIOWBhI1qxcrWr | 86400 | 1257401189 | +-----+------------------+--------+------------+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With