Skip to content
/ ttygrid Public

Automatically collapse tables based on the width of your terminal

Notifications You must be signed in to change notification settings

erikh/ttygrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 24, 2023
be535ae · Sep 24, 2023

History

33 Commits
Sep 24, 2023
Sep 24, 2023
Jun 29, 2021
Sep 20, 2023
Sep 20, 2023

Repository files navigation

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 with the demo source here. 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.

Author

Erik Hollensbe [email protected]

About

Automatically collapse tables based on the width of your terminal

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages