Monospace tag support

Make suggestions and report problems.
Post Reply
PhilW
Dalva Golden White Colheita 1952
Posts: 3503
Joined: 14:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Monospace tag support

Post by PhilW »

Until now we have not been able to simply cut/paste simple code/tables created for proportionate display without either spending ages wrapping them into some table format, or having to use the "code" tag. The latter has been the default method to cope when this issue is encountered, but this often fails to display much of what you may have wanted to be visible due to using a truncated window.

I have therefore added a new custom BBcode of "monospace", configured to address both issues. When wrapped with "monospace" tags, any text between the start and end tag will be (i) displayed in monotype font if the browser supports it, and (ii) adds tags to prevent the browser client from removing additional spaces causing mis-alignment. There is a "monospace" button now present in the text editor also, to support this.

Example:
A simple table with 6 lines and four columns, created in proportional spaced font.

A. Copy/pasted as text (a messy unclear layout/display):

A B C
01 John 1 2 23
02 Bill 3 16 2
03 Fred 12 9 13
04 Jane 18 1 7
05 William 5 7 4
06 Phil 17 12 5
07 Old Dave 17 12 5
08 Big John 17 12 5
09 Mike 17 12 5
10 Sarah 17 12 5
11 Lucy 17 12 5
12 Tony 17 12 5
13 Michel 17 12 5
14 Jo 17 12 5

B. Using "code" tag (current "workaround" method; clear, but truncated - if the bottom line included important totals, for example, these would not be immediately visible)

Code: Select all


               A   B   C
01 John        1   2  23
02 Bill        3  16   2
03 Fred       12   9  13
04 Jane       18   1   7
05 William     5   7   4
06 Phil       17  12   5
07 Old Dave   17  12   5
08 Big John   17  12   5
09 Mike       17  12   5
10 Sarah      17  12   5
11 Lucy       17  12   5
12 Tony       17  12   5
13 Michel     17  12   5
14 Jo         17  12   5

C. Using "monospace" tag (all data present, visible, with expected clear layout)

               A   B   C
01 John        1   2  23
02 Bill        3  16   2
03 Fred       12   9  13
04 Jane       18   1   7
05 William     5   7   4
06 Phil       17  12   5
07 Old Dave   17  12   5
08 Big John   17  12   5
09 Mike       17  12   5
10 Sarah      17  12   5
11 Lucy       17  12   5
12 Tony       17  12   5
13 Michel     17  12   5
14 Jo         17  12   5
User avatar
Alex Bridgeman
Graham’s 1948
Posts: 14880
Joined: 13:41 Mon 25 Jun 2007
Location: Berkshire, UK

Re: Monospace tag support

Post by Alex Bridgeman »

PhilW wrote: 12:41 Thu 20 Jun 2019 C. Using "monospace" tag (all data present, visible, with expected clear layout)

               A   B   C
01 John        1   2  23
02 Bill        3  16   2
03 Fred       12   9  13
04 Jane       18   1   7
05 William     5   7   4
06 Phil       17  12   5
07 Old Dave   17  12   5
08 Big John   17  12   5
09 Mike       17  12   5
10 Sarah      17  12   5
11 Lucy       17  12   5
12 Tony       17  12   5
13 Michel     17  12   5
14 Jo         17  12   5
That is really helpful! Thank you. I had no idea about the "code" workaround so I am now doubly educated.
Top Ports in 2023: Taylor 1896 Colheita, b. 2021. A perfect Port.

2024: Niepoort 1900 Colheita, b.1971. A near perfect Port.
User avatar
DRT
Fonseca 1966
Posts: 15779
Joined: 23:51 Wed 20 Jun 2007
Location: Chesterfield, UK
Contact:

Re: Monospace tag support

Post by DRT »

Splendid. Thank you.
"The first duty of Port is to be red"
Ernest H. Cockburn
Glenn E.
Graham’s 1977
Posts: 4174
Joined: 22:27 Wed 09 Jul 2008
Location: Seattle, WA, USA

Re: Monospace tag support

Post by Glenn E. »

All forums should be required to have this feature. This is brilliant.
Glenn Elliott
User avatar
jdaw1
Cockburn 1851
Posts: 23613
Joined: 15:03 Thu 21 Jun 2007
Location: London
Contact:

Re: Monospace tag support

Post by jdaw1 »

So tt is for inline monospace, and
monospace
is for multi-line monospace. Please confirm.
PhilW
Dalva Golden White Colheita 1952
Posts: 3503
Joined: 14:22 Wed 15 Dec 2010
Location: Near Cambridge, UK

Re: Monospace tag support

Post by PhilW »

jdaw1 wrote: 23:01 Sat 29 Jun 2019 So tt is for inline monospace, and
monospace
is for multi-line monospace. Please confirm.
Not quite. Either can be used inline or multiline. The main benefit of monospace is that it does NOT eat whitespace i.e. multiple sequential spaces will be reduced to a single space when submitting/storing/displaying the post (I do not know at which step the spaces are eaten) and this behaviour is unaffected by tt, but use of monospace retains all spaces, and hence desired alignment. Additionally monospace retains default colouring, whereas tt changes the background to white, and may add newlines also.

Hence, using the same lines when posting of
<space><space>4<space><space>8<space><space>Bill
<space>10<space>12<space>Mitch

in tt

4 8 Bill
10 12 Mitch


in monospace
  4  8 Bill
 10 12 Mitch
User avatar
Doggett
Morgan 1991
Posts: 1188
Joined: 17:40 Sun 20 Sep 2015
Location: Weymouth
Contact:

Re: Monospace tag support

Post by Doggett »

Posts like this never fail to make me feel intellectually challenged! 😀
Post Reply