table static method
Display a table
Implementation
static void table(List<List<String>> rows, {List<int>? columnWidths}) {
if (rows.isEmpty) return;
// Calculate column widths if not provided
final widths = columnWidths ?? _calculateColumnWidths(rows);
// Print each row
for (final row in rows) {
final cells = <String>[];
for (var i = 0; i < row.length && i < widths.length; i++) {
cells.add(row[i].padRight(widths[i]));
}
stdout.writeln(cells.join(' '));
}
}