SuperBot Appendix 6
Generating tables
SuperBot's table command creates plain text tables that are friendly to monospace fonts. For example,
=table Item,Cost
Total,120
Apple,30
Banana,25
Orange,30
Peach,35
Will give you the following table:
╔═══════════════╗
║ Item Cost ║
╟───────────────╢
║ Apple 30 ║
║ Banana 25 ║
║ Orange 30 ║
║ Peach 35 ║
╟───────────────╢
║ Total 120 ║
╚═══════════════╝
There are many styles you can use. Please check here for a list.
Use styles by prefixing the code with the style and three pipes. For example, to use the style called double_box:
=table double_box|||Item,Cost
Total,120
Apple,30
Banana,25
Orange,30
Peach,35
╔════════╦══════╗
║ Item ║ Cost ║
╠════════╬══════╣
║ Apple ║ 30 ║
╠════════╬══════╣
║ Banana ║ 25 ║
╠════════╬══════╣
║ Orange ║ 30 ║
╠════════╬══════╣
║ Peach ║ 35 ║
╠════════╬══════╣
║ Total ║ 120 ║
╚════════╩══════╝
So far, we've only been experimenting with tables with 2 columns. If we try to make one with more,
=table Index,Item,Unit price,Amount,Total price
,Total,,,355
1,Apple,3,30,90
2,Banana,4,25,100
3,Orange,2,30,60
4,Peach,3,35,105
╔════════════════════════════════════════════════════╗
║ Index Item Unit price Amount Total price ║
╟────────────────────────────────────────────────────╢
║ 1 Apple 3 30 90 ║
║ 2 Banana 4 25 100 ║
║ 3 Orange 2 30 60 ║
║ 4 Peach 3 35 105 ║
╟────────────────────────────────────────────────────╢
║ Total 355 ║
╚════════════════════════════════════════════════════╝
And now you want to make the first and last columns stand out. What do you do? - You just add $F$ and $F$.
They stand for First (column) and Last (column) respectively.
=table $F$$L$Index,Item,Unit price,Amount,Total price
,Total,,,355
1,Apple,3,30,90
2,Banana,4,25,100
3,Orange,2,30,60
4,Peach,3,35,105
╔═══════╦══════════════════════════════╦═════════════╗
║ Index ║ Item Unit price Amount ║ Total price ║
╟───────╫──────────────────────────────╫─────────────╢
║ 1 ║ Apple 3 30 ║ 90 ║
║ 2 ║ Banana 4 25 ║ 100 ║
║ 3 ║ Orange 2 30 ║ 60 ║
║ 4 ║ Peach 3 35 ║ 105 ║
╟───────╫──────────────────────────────╫─────────────╢
║ ║ Total ║ 355 ║
╚═══════╩══════════════════════════════╩═════════════╝
Always specify themes before column headings, and $F$ before $L$!
E.g. =table ascii|||$F$$L$
Sometimes, you might not want headers or footers in your table. You can use:
=table_plain function,sin(x)
X,π÷2
Y,0
╔═══════════════════╗
║ function sin(x) ║
║ X π÷2 ║
║ Y 0 ║
╚═══════════════════╝
Similarly, you can specify themes and heading columns for table_plain!