Wheelie
Wheelie

Reputation: 3916

Formatting tabular data using unicode characters

I need to produce a calculation trace file containing tabular data showing intermediate results. I am currently using a combination of the standard ascii pipe symbols (|) and dashes (-) to draw the table lines:

E.g.

Numerator | Denominator | Result
----------|-------------|-------
        6 |           2 |      3
       10 |           5 |      2

Are there any unicode characters that could be used to produce a more professional looking table?

(The file must be a raw text format and cannot use HTML or any other markup)

Edit: I've added an example of what the table now looks like having taken the suggestion on board and used the unicode box drawing characters:

Numerator │ Denominator │ Result
──────────┼─────────────┼───────
       6  │           2 │      3
       10 │           5 │      2

Upvotes: 4

Views: 2874

Answers (3)

kliop
kliop

Reputation: 51

You should look at this Javascript Box Drawing Demo. This is a JavaScript Unicode box drawing tool whose purpose is to make it easy for users to draw Unicode box art in HTML textareas. There you will see how to draw boxes using the arrow keys.

  • First you should select a style other than "Off".

  • Then using the arrow keys move around and you will see the box being drawn as you type

  • Once you are satisfied with the look of your drawing, simply copy it from the box and paste it on your HTML code.

Upvotes: 2

Keith Thomas
Keith Thomas

Reputation: 131

Your table is getting help from the monospaced font triggered by the code tags here. Proportional fonts can prevent tabular alignment of the digits. Unicode has digits that retain tabular alignment regardless of fonts in the Mathematical Alphanumeric Symbols from 1D7CE-1D7FF like these 𝟶𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿 &#x1D7F6 &#x1D7F7 &#x1D7F8 &#x1D7F9 &#x1D7FA &#x1D7FB &#x1D7FC &#x1D7FD &#x1D7FE &#x1D7FF

Upvotes: 1

Greg Hewgill
Greg Hewgill

Reputation: 994051

There are Unicode box drawing characters (look for Box Drawing under Geometrical Symbols - the chart itself is a PDF). I don't have any idea how widely supported those characters are, though.

Upvotes: 5

Related Questions