fabulous
Types
Takes a list of columns (strings), a list of rows (list of strings, each string being a cell), the max width for each cell, the alignment for column names, and alignment for the rows. Valid Alignments: Left, Right, Center (not case sensitive).
pub type Table {
Table(
cols: List(String),
rows: List(List(String)),
max_width: Int,
column_alignment: String,
row_alignment: String,
)
}
Constructors
-
Table( cols: List(String), rows: List(List(String)), max_width: Int, column_alignment: String, row_alignment: String, )
Functions
pub fn add_col(tab: Table, col: String) -> Table
Adds a column/key to the table; Take current table and new column name. Ensure to add columns before rows.
pub fn add_row(tab: Table, row: List(String)) -> Table
Adds a new row to the table. A row is a list of string, each string being the value for that a column (in order of columns). Add rows after and only after adding columns. If you want a value to be empty, include an empty string.