text/tabwriter: align tabbed columns in Go
Answer: Package tabwriter implements a write filter that translates tabbed columns in input into properly aligned text. It uses the Elastic Tabstops algorithm. The package is frozen and is not accepting new features.
What the filter does
Package tabwriter implements a write filter (tabwriter.Writer).
The filter translates tabbed columns in input into properly aligned text.
The package is frozen, so it is not accepting new features.
Alignment uses the Elastic Tabstops algorithm.
Creating a writer
NewWriter allocates and initializes a new Writer.
Flush should be called after the last call to Write.
A cell is a segment of text ended by a tab or a line break.
See also
Claims
- id: C1 claim: tabwriter translates tabbed columns into aligned text. source: S1 evidence: "translates tabbed columns in input into properly aligned text"
- id: C2 claim: The package uses the Elastic Tabstops algorithm. source: S1 evidence: "using the Elastic Tabstops algorithm"
- id: C3 claim: The package is frozen and is not accepting new features. source: S1 evidence: "frozen and is not accepting new features"
- id: C4 claim: A cell is text terminated by tabs or line breaks. source: S2 evidence: "terminated by tabs or line breaks"
Sources
- [S1] text/tabwriter package reference. Go. https://pkg.go.dev/text/tabwriter . License: BSD-3-Clause. Accessed 2026-11-23.
- [S2] text/tabwriter/tabwriter.go source. Go. https://go.dev/src/text/tabwriter/tabwriter.go . License: BSD-3-Clause. Accessed 2026-11-23.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go, text/tabwriter package reference; Go, text/tabwriter/tabwriter.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Go, text/tabwriter package reference; Go, text/tabwriter/tabwriter.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.
Cite this
iinventedlight. 2026. "text/tabwriter: align tabbed columns in Go." iinventedlight Library, iil:note:ynjnense, version of 2026-11-23. https://iinventedlight.com/library/notes/go-tabwriter/. License: CC-BY-4.0.
@misc{iil_note_ynjnense,
author = {{iinventedlight}},
title = {{text/tabwriter: align tabbed columns in Go}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-23},
url = {https://iinventedlight.com/library/notes/go-tabwriter/},
note = {Permanent ID iil:note:ynjnense. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- go-tabwriter.schema.json (schema; CC-BY-4.0)
- go-tabwriter.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-tabwriter.md.