std.tbl.calc_table_maxes

std.tbl

calc_table_maxes(headers, t) -> maxes

Calculate maximum display widths for each column in a table

Returns a table mapping column index (1-based) to the maximum display width of any cell in that column, including the header. Uses utf.display_len for correct handling of wide characters (CJK, emoji).

headers is an array of header definition strings (see parse_pipe_table_header). t is an array of rows, each row being an array of cell values.