使用unicode字符格式化表格数据

时间:2022-03-25 19:35:39

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:

我需要生成一个计算跟踪文件,其中包含显示中间结果的表格数据。我目前正在使用标准的ascii管道符号(|)和破折号( - )的组合来绘制表格行:

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?

是否有任何unicode字符可用于制作更专业的桌子?

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

(该文件必须是原始文本格式,不能使用HTML或任何其他标记)

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:

编辑:我添加了一个示例,表示现在看起来像是在船上采用了建议并使用了unicode框绘制字符:

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

1 个解决方案

#1


2  

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.

有Unicode框绘图字符(在几何符号下查找框图 - 图表本身是PDF)。但是,我不知道这些角色有多广泛支持。

#1


2  

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.

有Unicode框绘图字符(在几何符号下查找框图 - 图表本身是PDF)。但是,我不知道这些角色有多广泛支持。