Picnic is a Kotlin multiplatform library for constructing and rendering text-based tables. It provides a Kotlin DSL and Java builder API to define tables with features like borders, padding, text alignment, row/column spans, headers/footers, and multiple border styles (solid, rounded, ASCII). The library is well-architected with a clear separation between the model (Table, Cell, CellStyle), the DSL (dsl.kt), and the rendering engine (textRender.kt). The rendering algorithm performs a two-pass measurement and layout to handle complex cell spans and border merging, using a TextCanvas from the crossword library for drawing. The code is idiomatic Kotlin, fully multiplatform (JVM, JS, Native), and includes comprehensive tests. It is actively maintained with modern tooling (Kotlin 2.4, Gradle 9.6, Renovate for dependency updates).
This is a Go library for rendering richly formatted tables in a variety of output formats, including ASCII, Unicode, Markdown, HTML, ANSI-colored, and SVG. It provides both a batch mode (`Render`) and a streaming mode (`Start`, `Append`, `Close`) for incremental table generation. The library supports advanced features such as horizontal, vertical, and hierarchical cell merging, per-column alignment, padding, word wrapping, and custom cell formatters. It includes a CLI tool `csv2table` that converts CSV input to tables with the full feature set. The codebase is modular, with separate packages for display width calculation (East Asian language support), word wrapping (minimal raggedness algorithm), an LRU cache, and a set of pluggable renderers. Configuration is done via functional options and a fluent `ConfigBuilder` pattern. Although comprehensive, the API is in a state of transition: many legacy methods (e.g., `SetBorder`, `SetAutoFormatHeaders`) are deprecated, and the migration guide warns that the current version (v1) is still evolving. The architecture is sound, with clear separations between data processing (`tablewriter` core), presentation (`tw` types and `renderer` implementations), and utility packages (`twwidth`, `twwarp`, `twcache`). The library is well-tested with over 50 test files and benchmarks, and demonstrates strong engineering practices.