ASCII Table Drawer
Draw formatted ASCII and Unicode box-drawing tables from your data. Supports 6 border styles, column alignment, copy, and export.
About
Misaligned plain-text tables break readability in code comments, README files, terminal output, and technical documentation. Manual spacing with spaces or tabs drifts the moment a cell value changes length. This tool computes per-column maximum widths across all rows, then pads each cell with the exact whitespace needed for perfect vertical alignment. It supports six border character sets: classic ASCII (+-|), Unicode single-line, Unicode double-line, Unicode rounded-corner, Markdown pipe syntax, and reStructuredText grid format. Column alignment (left, center, right) is configurable independently. Output is pure text, safe to paste into any monospaced context without rendering dependencies.
The width algorithm measures each cell string by its character count (not byte length), so multi-byte Unicode content is handled correctly. Note: visual alignment assumes a monospaced font at the destination. Proportional fonts will misalign columns regardless of padding accuracy. For CJK or emoji content, character display widths may differ from codepoint counts. This tool approximates width as codepoint length, which is correct for Latin, Cyrillic, and most symbol sets.
Formulas
The core operation is per-column width calculation followed by padded cell rendering.
Where Wj is the computed width of column j, len returns the character count of the cell string, R is the total number of rows, and celli,j is the trimmed content at row i, column j.
Where C is the column count, 2 accounts for left and right padding spaces per cell, and C + 1 counts the vertical border characters. This gives the total line length for checking terminal overflow.
For left alignment: padded = cell + spaces(Wj โ len(cell)). For right alignment: padded = spaces(Wj โ len(cell)) + cell. For center alignment: left padding = floor((Wj โ len(cell)) รท 2), right padding gets the remainder.
Reference Data
| Border Style | Top-Left | Horizontal | Top-Join | Top-Right | Vertical | Cross | Bottom-Left | Bottom-Right | Use Case |
|---|---|---|---|---|---|---|---|---|---|
| ASCII | + | - | + | + | | | + | + | + | Universal compatibility, code comments |
| Unicode Single | โ | โ | โฌ | โ | โ | โผ | โ | โ | Terminal UI, modern CLI tools |
| Unicode Double | โ | โ | โฆ | โ | โ | โฌ | โ | โ | Headers, emphasis, DOS-style interfaces |
| Unicode Rounded | โญ | โ | โฌ | โฎ | โ | โผ | โฐ | โฏ | Friendly terminal output, chat bots |
| Markdown | - | | | | | | | GitHub, GitLab, documentation sites | ||||
| reStructuredText | + | = | + | + | | | + | + | + | Sphinx docs, Python documentation |
| Compact | Minimal space, log files | ||||||||
| Dots | . | . | . | . | : | : | . | . | Decorative, retro aesthetic |
| Common column count | Typical tables: 2 - 12 columns | Beyond 12 columns may exceed terminal width (80 - 120 chars) | |||||||
| Terminal width (standard) | 80 characters | POSIX default, many legacy systems | |||||||
| Terminal width (modern) | 120 - 200 characters | Modern terminals, wide monitors | |||||||
| Padding convention | 1 space each side | Standard readability padding inside cells | |||||||
| Alignment: Left | Cell content padded right | Default for text data | |||||||
| Alignment: Right | Cell content padded left | Numeric data, currency, counts | |||||||
| Alignment: Center | Split padding both sides | Headers, labels, short values | |||||||