The table string
const testdata = [ [ "マスコットキャラクタ": "D-man", "about": "Programming Language" ], [ "マスコットキャラクタ": "D言語くん", "about": "プログラミング言語" ], ]; const reference = " マスコットキャラクタ about \n" ~ "---------------------- ----------------------\n" ~ " D-man Programming Language \n" ~ " D言語くん プログラミング言語 "; assert(tabulate(testdata, Config(Style.simple, Align.center, true)) == reference);
Tabulate an array of associative array.
This version tabulates an array of associative array. The keys will be used as headers and there is no need to align each keys of each array elements. If some missing key exists in the one line, that cell will be empty.