I'm trying to print a table that's more pleasant to the eye than the pure text representation of it. basically I want to convert something like this:
+-----+--------+
| age | weight |
+-----+--------+
| 10 | 100 |
| 80 | 500 |
+-----+--------+
to something like this:
┌─────┬────────┐
| age | weight |
├─────┼────────┤
│ 10 │ 100 │
│ 80 │ 500 │
└─────┴────────┘
here is the screenshot of what I see in terminal:
Notice the gaps between the rows. My problem is that they are not connecting properly while other Unix tools that use ANSI printing look fine in terminal. For example, tree, if I run tree -A
in my terminal `I get this:
notice how vertical lines are connected together. it's funny because when I copy and paste the output of tree into my text editor and run my script I get something like this:
Obviously I'm missing something about printing ANSI chars in terminal and couldn't find anything about it by googling it. can anyone shed some light on this topic?