greenServeFE logogreenServeFELanguage, VM and Native Module Reference

Documentation home / Native Module API

Native Module API

Formatted Table Rendering

Render arrays as terminal-friendly formatted tables, CSV text or Markdown tables, and inspect row/column counts.

Purpose

Render arrays as terminal-friendly formatted tables, CSV text or Markdown tables, and inspect row/column counts.

Exported API

ExportRole
renderrender native function or exported value
csvcsv native function or exported value
markdownmarkdown native function or exported value
row_countrow count native function or exported value
column_countcolumn count native function or exported value

Usage example

import gs_table;
define headers = ["Name", "Score"];
define rows = [["Alex", 95], ["Sam", 88]];
print(gs_table.render(headers, rows, {title: "Scores", align: ["left", "right"]}));
print(gs_table.csv(headers, rows));
print(gs_table.markdown(headers, rows));
render(headers, rows, options) supports title, padding, widths, align, border and header options.

Related documentation