CLI & text · real, tested code

Pretty-Print a Table in Larzscript

Render tabular data as an aligned ASCII table for the terminal, or Markdown for a README.

table.render() takes a header row plus data rows and column-aligns everything automatically; table.to_markdown() renders the same data as a Markdown table.

larzscript pkg install table

Code

import "table" as table

let rows = [["Name", "Language"], ["Ada", "Larzscript"], ["Bo", "Python"]]
print(table.render(rows))
print(table.to_markdown(rows))
Output
| Name | Language   |
|------|------------|
| Ada  | Larzscript |
| Bo   | Python     |
| Name | Language   |
|------|------------|
| Ada  | Larzscript |
| Bo   | Python     |