https://github.com/erikh/ttygrid
Automatically collapse tables based on the width of your terminal
https://github.com/erikh/ttygrid
Last synced: about 1 year ago
JSON representation
Automatically collapse tables based on the width of your terminal
- Host: GitHub
- URL: https://github.com/erikh/ttygrid
- Owner: erikh
- Created: 2021-06-29T03:15:07.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-09-24T05:00:53.000Z (over 2 years ago)
- Last Synced: 2025-04-20T09:39:09.177Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 34.2 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ttygrid: reactive layouts for terminal tables
ttygrid makes your tables into reactive layouts. You feed it your contents and
the columns you want to show, and it will calculate what to show based on the
length of text in the table column, and the "priority", an ascending number
indicating display priority within the table.
The result is something like [this](https://asciinema.org/a/609115) with [the
demo source here](examples/demo.rs). Padding is allocated for all columns so
the tables are presented nicely and orderly.
**ttygrid does not work with stream I/O. Terminal I/O only!**. At this point,
you must detect if you are a TTY _before_ invoking ttygrid calls.
ttygrid uses crossterm underneath the hood to detect the width of the terminal
as well as manage colors when they are desired.
## Usage
[docs.rs has it all](https://docs.rs/ttygrid/).
## Author
Erik Hollensbe