Pads each cell to its column width and joins with pipes
All 8 scenarios hold
Column widths come from the Column width feature, measured in display columns. The formatter pads every cell except the last to its column width plus one space before the pipe. It writes one space after the pipe for every cell after the first. It never pads the last column, so no line carries trailing spaces. The header row follows the same rule as a data row.
expected outcome
broken scenario
| Scenario | Cells | Column widths | Row? |
|---|---|---|---|
| Cells that exactly fill their columns |
|
| Alice | 30 |
| Cells shorter than their columns |
|
| Bob | 7 |
| Three columns |
|
| a | bb | c |
| An empty first cell |
|
| | 30 |
| An empty middle cell |
|
| a | | c |
| An empty last cell |
|
| short | |
| A single column |
|
| Alice |
| Two-column glyphs |
|
| 中文 | x |