You've already forked uutils-term-grid
mirror of
https://github.com/uutils/uutils-term-grid.git
synced 2026-06-10 16:13:01 -07:00
b57bf4541c
Since I wanted to add a 'display in n columns' method, the maximum width of the console would never be relevant, so this had to get moved to a parameter. The Display stuff is just a bonus.
16 lines
354 B
Rust
16 lines
354 B
Rust
extern crate term_grid;
|
|
use term_grid::{Grid, GridOptions, Direction};
|
|
|
|
fn main() {
|
|
let mut grid = Grid::new(GridOptions {
|
|
direction: Direction::TopToBottom,
|
|
separator_width: 2,
|
|
});
|
|
|
|
for i in 0..40 {
|
|
grid.add(format!("{}", 2_isize.pow(i)).into())
|
|
}
|
|
|
|
println!("{}", grid.fit_into_width(40).unwrap());
|
|
}
|