tablewriter

A Go library for rendering rich ASCII, Unicode, Markdown, HTML, and colorized tables, with streaming support for large datasets.

Library
Go
vv1.1.4
4,808stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
71/100Good
Development Activity72
Maintenance48
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture78
Code Quality82
Innovation74
Learning Curve65

tablewriter is a Go library for turning slices, structs, and CSV data into formatted tables. It ships multiple renderers — ASCII (Blueprint), Unicode, Markdown, HTML, SVG, and ANSI-colorized — behind a single API, so the same table data can target a terminal, a Markdown doc, or a web page just by swapping the renderer.

Beyond basic rendering it supports cell merging, per-section (header/row/footer) alignment and padding, Unicode-aware column widths for CJK and emoji content, struct-tag driven population with generics, and a streaming mode (the Ocean renderer) for writing very large tables incrementally instead of buffering everything in memory. Configuration is handled through a large set of composable functional options (With*()), letting callers override borders, symbols, filters, and callbacks at global or per-column granularity.

What You Get

  • A Table type built via NewTable/NewWriter that accepts headers, rows, and footers from slices, structs (via tw struct tags), or CSV readers
  • Six renderers out of the box — Blueprint (ASCII), Markdown, HTML, Colorized, Ocean (streaming), and SVG — swappable without changing how data is added
  • A streaming mode for rendering large datasets row-by-row without buffering the whole table
  • Cell merging, per-section alignment/padding/filters, and custom border symbol sets configurable through With*() functional options
  • Unicode-aware width calculation (via grapheme segmentation) so CJK characters and emoji don’t break column alignment
  • A companion csv2table CLI in cmd/ for converting CSV files to formatted tables from the command line

Common Use Cases

  • CLI tool output - Developers building command-line tools format structured data (status reports, diffs, inventories) as readable terminal tables.
  • Log and report formatting - Backend services render tabular summaries (job results, test reports) as Markdown or HTML for docs and dashboards.
  • CSV to table conversion - Data pipelines and admin scripts import CSV files directly via NewCSVReader/NewCSV and render them as formatted output.
  • Database result display - Applications with sql.Null* support print query results directly as terminal tables without manual null-handling.

Under The Hood

Architecture A Table struct holds row/header/footer data as [][]string alongside computed column widths and a pluggable tw.Renderer interface implementation (Blueprint, HTML, Markdown, Colorized, Ocean, SVG all live under renderer/). Rendering runs through an internal renderContext/mergeContext pair that tracks per-section widths, merge state, and visible-column counts before handing lines to the active renderer, keeping layout computation separate from output formatting. Shared low-level types (Mapper, CellConfig, Position, MergeState) live in the tw/ package, while pkg/twwidth, pkg/twcache, and pkg/twwarp isolate Unicode width measurement, reflection-stringer caching, and text wrapping as independent, individually testable units. Streaming mode (stream.go) carries its own state (streamWidths, streamRowCounter, lastRenderedLineContent) so the Ocean renderer can emit rows incrementally without buffering the full table, and a large option.go exposes dozens of With*() functional options as the sole mutation surface into Config.

Tech Stack Written in Go 1.21 with a deliberately small dependency footprint: clipperhouse/displaywidth and clipperhouse/uax29/v2 for Unicode grapheme segmentation and display-width math, mattn/go-runewidth as a secondary width source, fatih/color for ANSI terminal coloring, and olekukonko/errors plus olekukonko/ll for typed errors and structured debug logging. There’s no web framework, ORM, or database driver in the dependency graph — this is a pure formatting library, built with the standard go build/go test toolchain and distributed as an importable module (plus a small cmd/csv2table CLI built on top of it).

Code Quality Test coverage is extensive: 23 _test.go files, including 15 top-level test functions in tablewriter_test.go and a dedicated tests/ directory covering blueprint, markdown, HTML, colorized, streaming, merge, struct, CSV, and SVG rendering paths, plus benchmark files for width calculation and caching. A .golangci.yml enforces linting, and GitHub Actions runs go build and go test -v ./... on every push and pull request to master. Errors are surfaced through a typed errors package and an ll structured logger rather than swallowed, and package boundaries (pkg/twwidth, pkg/twcache, pkg/twwarp) keep low-level concerns unit-testable in isolation.

What Makes It Unique Most ASCII table libraries stop at fixed-width columns and a single output format; tablewriter unifies six renderers (ASCII, Unicode, Markdown, HTML, SVG, ANSI-colorized) behind one data-population API, adds a genuine streaming renderer for datasets too large to buffer, and uses real Unicode grapheme segmentation rather than naive rune counting to keep columns aligned across CJK text and emoji. Struct-tag driven population with generics support and a comprehensive functional-options system for per-section (header/row/footer) and per-column overrides give it a configuration surface closer to a rendering engine than a simple formatting helper.

Used by 10 apps in this directory

Go
68%
MIT

Gogs

Developer Tools

47,783

The painless self-hosted Git service that runs on anything from a Raspberry Pi to a $5 cloud droplet, delivering GitHub-like workflows as a single Go binary.

View details
96
Repo Health
79
Technical
72
Dependency
Built with
Go68%
Go Template16%
TypeScript10%
Updated 4 days ago
TypeScript
49%
AGPL 3.0

Grafana

Monitoring · Analytics

76,498

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
65
Dependency
Built with
TypeScript49%
Go45%
Updated today
Go
99%
AGPL 3.0

MinIO

File Storage

61,375

High-performance, S3-compatible object storage built for AI/ML and analytics workloads — run it anywhere from a laptop to a petabyte-scale cluster.

View details
60
Repo Health
85
Technical
66
Dependency
Built with
Go99%
Updated 4 months ago
Go
71%
MIT

Ollama

AI Development · Developer Tools

179,765

Run Llama, Gemma, DeepSeek, and other open LLMs on your own machine with one command and an OpenAI-compatible API.

View details
89
Repo Health
85
Technical
69
Dependency
Built with
Go71%
C21%
Updated yesterday
Go
48%
Apache 2.0

opencloud

File Storage

5,868

Open source file management and collaboration platform that keeps your data under your control, no database required.

View details
85
Repo Health
80
Technical
69
Dependency
Built with
Go48%
Gherkin36%
PHP12%
Updated yesterday
Go
93%
MIT

Plandex

AI Code Assistants

15,598

An open-source, terminal-based AI coding agent built for large tasks and real codebases — with its own version control for plans, a 2M-token effective context window, and self-hosted or cloud deployment.

View details
49
Repo Health
70
Technical
68
Dependency
Built with
Go93%
Updated 11 months ago
Go
90%
AGPL 3.0

Pyroscope

Monitoring · Devops · Developer Tools

11,643

An open-source, horizontally scalable continuous profiling platform that pinpoints CPU, memory, and I/O bottlenecks down to the exact line of code, built by Grafana Labs alongside Loki, Tempo, and Mimir.

View details
91
Repo Health
89
Technical
66
Dependency
Built with
Go90%
Updated 2 days ago
Go
98%
Apache 2.0

Space Cloud

Devops · Authentication

3,998

Kubernetes-native serverless platform that generates instant GraphQL and REST APIs for any database with built-in auth and real-time subscriptions

View details
50
Repo Health
74
Technical
63
Dependency
Built with
Go98%
Updated 2 years ago
Go
99%
MIT

temporal

Automation · Devops

22,602

Open-source durable execution platform that keeps mission-critical workflows running through any failure, automatically.

View details
92
Repo Health
85
Technical
69
Dependency
Built with
Go99%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search