A column is as wide as its widest cell

All 5 scenarios hold

Widths are measured in terminal display columns (see Display width rules), not in characters. The header counts as a cell like any other; the column separator is not part of the width.

expected outcome broken scenario
ScenarioCells in columnWidth?
Widest cell sets the width
  • a
  • dddd
  • bb
4
Header is a cell like any other
  • name
  • Alice
  • Bob
5
Empty cells add no width
  • “”
  • longest
7
CJK characters are two columns wide
  • name
  • 中文
  • 日本語
6
Emoji are two columns wide
  • x
  • 😀
2