A Go library for easily pretty-printing tabular data from arrays, slices, and maps with customizable formatting.
Gotabulate is a Go library that formats tabular data from arrays, slices, and maps into visually appealing text tables. It solves the problem of manually formatting data for console output by providing simple functions to create tables with headers, alignment, and text wrapping.
Go developers building command-line tools, loggers, or data inspection utilities who need to display structured data cleanly in terminal output.
Developers choose Gotabulate for its straightforward API, support for multiple Go data types, and customizable table styles without external dependencies, making it a lightweight alternative to manual formatting or heavier table libraries.
Gotabulate - Easily pretty-print your tabular data with Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library uses straightforward methods like Create(), SetHeaders(), and Render() with only two style options, making it easy to pick up and use without a steep learning curve, as shown in the concise examples.
It handles multiple Go data structures including 2D arrays of int, int64, float64, string, interface{}, and maps with string keys, allowing developers to directly format common data types without pre-processing.
Offers 'simple' and 'grid' table styles with configurable alignment (left, right, center) and string wrapping via SetMaxCellSize(), providing control over presentation for better readability in console output.
Headers can be set optionally, and the library automatically uses map keys or the first row if not specified, reducing boilerplate code for quick table generation.
The project is explicitly marked as beta with acknowledged edge cases that may cause improper rendering, making it less reliable for production-critical applications where stability is key.
As noted in the TODO list, decimal point alignment for floats is not yet implemented, which is a common requirement for clean numerical table displays and limits its utility for financial or scientific data.
It only supports text-based console output (simple and grid styles), with no built-in support for HTML, CSV, or other formats, restricting its use in web or multi-format export scenarios.