Using Code

Joined
18 Oct 2007
Messages
10,590
Reaction score
1,353
Location
Kent
Country
United Kingdom
This would be a useful facility - if it worked properly :rolleyes:

You layout a table of data using code and press the preview button to check it looks right. NO, it does not; data which was in neat columns is all over the place. So you have to experiment, which can take a long time. Eventually your typed version looks a complete mess, BUT the submitted version is just what you wanted.

The reason for this is not difficult to find. When you type in the box you are using a proportional font (letter widths vary, so an"i" occupies less space than an "m"). When code is used, the final result is displayed in a fixed width font (all letters occupy the same space).

1. Is it necessary to use a fixed width font for code? All code effectively means is: don't compress any white space down to just one space.

2. If a fixed width font is necessary, could this font be made available for typing code text?
 
Sponsored Links
[code:1]-------------------------------
| Name | Age | Gender |
-------------------------------
| Paul | 10 | Male |
| Simon | 29 | Unknown |
-------------------------------[/code:1]

-------------------------------
| Name | Age | Gender |
-------------------------------
| Paul | 10 | Male |
| Simon | 29 | Unknown |
-------------------------------




Ok, yup, see what you mean. The input text area of the message box will not match the outputed preview/post.

This is common over most forums I believe - It is something that could be changed, perhaps a javascript button which can change the text type of the input area on the fly.

Code is generally used when posting 'code', not something that is done hugely on this forum. For tables etc you are better using List I believe?

Some forums do have 'tables'.
 
Sponsored Links
For tables etc you are better using List I believe?
Tried list, it's no good for setting out tables. If you put multiple white spaces between entries on the same line, they are compresses down to a single space when previewed. The only thing list does is to automatically reduce the font size.

Using code
[code:1]
a b c d e
1 2 3 4 e
[/code:1]
Using list

  • a b c d e
    1 2 3 4 e
Code is the only way of inserting tables of data; just a pity it's a pain to use. :mad:
 
test cell 1test cell 2
test cell 3test cell 4


Nope - doesn't work here!
 
As a workaround you could use notepad with the font set to courier new to format your text, then cut and paste it into the forum input box.
 
That's what I always do - Notepad (or Word - in fact anything which provides a monospace font).

It would be better if there were font face options for posts, just like there are options for size, colour, italics etc.

Or even if we could just have monospaced text, like wot the Wiki supports.
 
Sponsored Links
Back
Top