Solution 1 :

The reason why the tag is used in such cases is to maintain the formatting of the text. With the , you can easily display on your browser the format used in the code editor. So, it is a formatting method that helps you structure your elements without having to go through the stress of writing loads of CSS.

Solution 2 :

pre, xmp, plaintext, listing {
    display: block;
    font-family: monospace;
    white-space: pre;
    margin: 1__qem 0
}

<pre> tag, it can be used alone, It is a block-level element and cannot be used in ‘inline elements’. It is just a tag, it’s just preset with different styles. In addition, there are no special regulations as to how and where to use it.

Problem :

Recently I’ve come across a few ‘tables’ formatted with the ‘pre’ tag where the actual table is inside of one ‘td’ cell. Why would anyone be constructing a ‘table’ this way instead of just using ‘tr’ and ‘td’ tags and populating the table data into cells? What are the advantages if any?

<table>
<tr><td colspan="2"><pre><div style="font-size:12px"><b>________________________________________________________________________________________________________________________________
Pos Car  Competitor/Team                Driver                   Vehicle              Cap   CL   Laps   Fastest...Lap        Gap</b>

1   111  Goodwin and Kenyon Group       Cameron Hill (ACT)       Porsche 991 GT3 Cup  3996  P      12    11 1:22.3686* 
2    36  Phase 8                        Cooper Murray (VIC)      Porsche 991 GT3 Cup  3996  P      14    13 1:22.4557  0:00.0871
3   100  Timken                         Dale Wood (Vic)          Porsche 991 GT3 Cup  3996  P      12     8 1:22.5288  0:00.1602
4    38  Wall Racing                    David Wall (NSW)         Porsche 991 GT3 Cup  3996  P      14    14 1:22.7707  0:00.4021
5     8  Porsche Centre Melbourne       Nick McBride (VIC)       Porsche 911 GT3 Cup  3996  P      12    11 1:22.8454  0:00.4768
6    77  Sonic/Bob Jane T-Marts/PSA     Michael Almond (SA)      Porsche 991 GT3 Cup  3996  P      12    11 1:22.9144  0:00.5458
7   777  Sonic/Bob Jane T-Marts/Exedy   Max Vidau (SA)           Porsche 991 GT3 Cup  3996  P      13    13 1:23.2087  0:00.8401
8    34  Hyundai Forklifts Aus          Duvashen Padayachee NSW  Porsche 991 GT3 Cup  3996  P      12    12 1:23.2475  0:00.8789
9    15  Volante Rosso                  Josh Hunt (QLD)          Porsche 991 GT3 Cup  3996  P      13    13 1:23.2663  0:00.8977
10   23  Lago Cold Stores/Dayco         David Russell (QLD)      Porsche 991 GT3 Cup  3996  P      12    12 1:23.2852  0:00.9166
11   78  Sonic/Barbagallo/Porsche Centr Aaron Love (WA)          Porsche 991 GT3 Cup  3996  P      13    13 1:23.3455  0:00.9769
12   96  Brennan IT                     Joey Mawson (NSW)        Porsche 991 GT3 Cup  3996  P      12     9 1:23.8414  0:01.4728
13   12  HeliMods                       Harrison Jones (QLD)     Porsche 991 GT3 Cup  3996  P      12    12 1:23.8630  0:01.4944
14    4  Grove Group                    Stephen Grove (VIC)      Porsche 991 GT3 Cup  3996  A      12    12 1:24.0758  0:01.7072
15   80  Max Twigg                      Max Twigg (VIC)          Porsche 991 GT3 Cup  3996  A      11    11 1:24.3102  0:01.9416
16   22  BMF Racing                     Dean Cook (VIC)          Porsche 991 GT3 Cup  3996  A      13    11 1:24.4770  0:02.1084
17    6  No Second Chance               Tim Miles (NSW)          Porsche 991 GT3 Cup  3996  A       9     9 1:24.7753  0:02.4067
18    9  Hallmarc                       Marc Cini (VIC)          Porsche 911 GT3 Cup  3996  A      12    11 1:27.4027  0:05.0341
19   35  RENTCORP FORKLIFTS             Indiran Padayachee (NSW) Porsche 991 GT3 Cup  3996  A      12     7 1:27.6902  0:05.3216
20  222  Scott Taylor Motorsport        Scott Taylor (QLD)       Porsche 991 GT3 Cup  3996  A      12    11 1:28.2614  0:05.8928
21   30  Sparesbox                      David Ryan (NSW)         Porsche 991 GT3 Cup  3996  A      12    11 1:28.9762  0:06.6076
22   68  Wall Racing                    Greg Ward (NSW)          Porsche 991 GT3 Cup  3996  A      12    11 1:32.0664  0:09.6978

Fastest Lap Av.Speed Is 141kph, 109% Of First 1 Is 1:29.7818
Current Practice/Qualify Record Is 1:21.2952 Set On 02/03/2018 By Jaxon Evans (QLD) In A Porsche 911 GT3 Cup
R=under lap record by greatest margin, r=under lap record, *=fastest lap time
</div>
</pre>
</td></tr>
</table>

Comments

Comment posted by Ry-

A few where? The answer as far as good document-writing practice goes is “never”, though. (A plain-text version of a table can be useful, but that’s what links are for.)

By

Leave a Reply

Your email address will not be published. Required fields are marked *