User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Column Alignment
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

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.

ascii table text table box drawing unicode table markdown table plain text table table generator ascii art

Formulas

The core operation is per-column width calculation followed by padded cell rendering.

Wj = max(len(celli,j)) for all rows i โˆˆ [0, R)

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.

totalWidth = Cโˆ’1โˆ‘j=0 (Wj + 2) + (C + 1)

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 StyleTop-LeftHorizontalTop-JoinTop-RightVerticalCrossBottom-LeftBottom-RightUse 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 countTypical tables: 2 - 12 columnsBeyond 12 columns may exceed terminal width (80 - 120 chars)
Terminal width (standard)80 charactersPOSIX default, many legacy systems
Terminal width (modern)120 - 200 charactersModern terminals, wide monitors
Padding convention1 space each sideStandard readability padding inside cells
Alignment: LeftCell content padded rightDefault for text data
Alignment: RightCell content padded leftNumeric data, currency, counts
Alignment: CenterSplit padding both sidesHeaders, labels, short values

Frequently Asked Questions

ASCII/Unicode tables require a monospaced (fixed-width) font to align correctly. Fonts like Courier New, Consolas, or Menlo assign identical width to every character. Proportional fonts (Arial, Times New Roman) vary character widths, so columns drift. Always paste into a code block, <pre> tag, or set the font to monospaced at the destination.
Use the Markdown style. GitHub's renderer natively interprets pipe-delimited tables with | column separators and --- header separators. Unicode box-drawing characters will render correctly inside fenced code blocks (```) but won't be interpreted as structured tables by the Markdown parser.
Ragged input is normalized. The parser determines the maximum column count across all rows, then pads shorter rows with empty string cells. This ensures every row renders with the same number of columns. No data is discarded. If you have a row with 3 values and another with 5, the first row gets 2 empty trailing cells.
Yes. Select Tab as the delimiter. When you copy cells from Excel, Google Sheets, or LibreOffice Calc, the clipboard contains tab-separated values. Paste directly into the input area, select Tab delimiter, and the parser will split columns correctly. Each row in the spreadsheet corresponds to one line in the input.
The tool runs entirely in your browser with no server round-trip. Practical limits depend on your device memory. Tables up to 1000 rows and 50 columns render instantly. Beyond 10000 rows, the output string becomes large and copying to clipboard may briefly freeze the UI. The tool does not impose an artificial limit.
Yes. Windows Command Prompt (cmd.exe) supports Code Page 437 and Code Page 65001 (UTF-8), both of which include double-line box-drawing characters (โ•”, โ•, โ•‘). Ensure your terminal font is set to Consolas or Lucida Console. PowerShell and Windows Terminal support the full Unicode range natively.