Display query results or structured data in a CLI tool with aligned columns and borders
Render Markdown-compatible tables for documentation generators or README output
Stream large datasets row by row to a terminal without loading everything into memory
Output colorized or Unicode-styled tables in interactive terminal applications
go get github.com/olekukonko/tablewriter. Use v1.1.4+ for generics and streaming, skip v1.0.0 (missing features). v0.0.5 for legacy projects.
Tablewriter is a Go library that generates formatted tables in plain text. If you are building a command-line tool and want to display data in neat rows and columns rather than raw comma-separated output, this library handles the formatting work for you. You give it rows of data, and it draws the borders, aligns the columns, and adjusts widths automatically. The library supports several output formats beyond basic ASCII: Unicode box-drawing characters for cleaner terminal output, Markdown table syntax for documentation, HTML tables for web output, and ANSI color codes for colorized terminals. There is also a streaming mode called Ocean that renders rows as they arrive rather than waiting for all data to be loaded into memory first, which is useful when working with large datasets. Styling options include merging adjacent cells that share the same value, setting per-column or per-cell alignment, controlling which borders and separator lines appear, and replacing the default border characters with custom ones. The README demonstrates a playful example using emoji as table corners. For data input the library accepts plain string slices, Go structs, or data from a CSV source, and it handles Go's nullable database types from the standard sql package without extra conversion. Two version lines exist. Version 0.0.5 is described as the stable legacy release, suitable for existing projects. Version 1.1.4 and later is the current line and adds generics support along with the newer streaming APIs. Version 1.0.0 is explicitly flagged in the README as missing functionality and should be skipped. The project is open source under the MIT license.
← olekukonko on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.