Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qrichert/verynicetable
Number one table.
https://github.com/qrichert/verynicetable
console rust rust-library table terminal tui
Last synced: about 2 months ago
JSON representation
Number one table.
- Host: GitHub
- URL: https://github.com/qrichert/verynicetable
- Owner: qrichert
- License: mit
- Created: 2024-08-28T18:52:05.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-15T09:31:58.000Z (5 months ago)
- Last Synced: 2024-09-16T00:29:04.490Z (5 months ago)
- Topics: console, rust, rust-library, table, terminal, tui
- Language: Rust
- Homepage: https://docs.rs/verynicetable
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# very nice table
[![license: MIT](https://img.shields.io/badge/license-MIT-blue)](https://opensource.org/license/mit)
![GitHub Tag](https://img.shields.io/github/v/tag/qrichert/verynicetable?sort=semver&filter=*.*.*&label=release)
[![crates.io](https://img.shields.io/crates/d/verynicetable?logo=rust&logoColor=white&color=orange)](https://crates.io/crates/verynicetable)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/qrichert/verynicetable/run-tests.yml?label=tests)](https://github.com/qrichert/verynicetable/actions)_Number one table._
Very basic and lightweight table builder to print tabular data.
## Example
```rust
use std::fmt::Alignment::{Left, Right};
use verynicetable::Table;fn main() {
let ports = vec![
vec!["rapportd", "449", "Quentin", "*:61165"],
vec!["Python", "22396", "Quentin", "*:8000"],
vec!["foo", "108", "root", "*:1337"],
vec!["rustrover", "30928", "Quentin", "127.0.0.1:63342"],
vec!["Transmiss", "94671", "Quentin", "*:51413"],
vec!["Transmiss", "94671", "Quentin", "*:51413"],
];let table = Table::new()
.headers(&["COMMAND", "PID", "USER", "HOST:PORTS"])
.alignments(&[Left, Right, Left, Right])
.data(&ports)
.max_rows(5)
.to_string();print!("{table}");
}
``````
COMMAND PID USER HOST:PORTS
rapportd 449 Quentin *:61165
Python 22396 Quentin *:8000
... ... ... ...
rustrover 30928 Quentin 127.0.0.1:63342
Transmiss 94671 Quentin *:51413
Transmiss 94671 Quentin *:51413
```That's about it.