An array of array data
A table-wide configuration
Configurations for each columns (The length should match with data)
The table string
const testdata = [ ["D-man", "Programming Language"], ["D言語くん", "プログラミング言語"], ]; const tableConfig = TableConfig(Style.simple, " ", " ", true); const columnConfigs = [ ColumnConfig(20, "マスコットキャラクタ", Align.center), ColumnConfig(10, "about", Align.center) ]; const reference = " マスコットキャラクタ about \n" ~ "---------------------- ------------\n" ~ " D-man ..ming L.. \n" ~ " D言語くん ..ラミン.. "; assert(tabulate(testdata, tableConfig, columnConfigs) == reference);
Tabulate an array of array data with detailed configurations.
This version uses TableConfig and an array of ColumnConfig instead of Config. TableConfig affects the whole table appearance and ColumnConfigs affect each columns' appearance. This can be used if you want to configure (e.g.) columns one-by-one.