Print a borderless, left-aligned table, like `docker ps` / `kubectl get`: columns separated by two spaces, an uppercase header, no rules.
(headers: list[str], rows: list[list[str]])
| 131 | |
| 132 | |
| 133 | def render_table(headers: list[str], rows: list[list[str]]) -> None: |
| 134 | """Print a borderless, left-aligned table, like `docker ps` / `kubectl get`: |
| 135 | columns separated by two spaces, an uppercase header, no rules.""" |
| 136 | widths = [max(len(r[c]) for r in [headers, *rows]) for c in range(len(headers))] |
| 137 | for r in [headers, *rows]: |
| 138 | print(" ".join(cell.ljust(w) for cell, w in zip(r, widths)).rstrip()) |
| 139 | |
| 140 | |
| 141 | def _format_expires(dt: datetime.datetime | None) -> str: |
no test coverage detected