1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
fn main() {
    use text_grid::*;
    struct RowData {
        a: f64,
        b: f64,
    }
    impl CellsSource for RowData {
        fn fmt(f: &mut CellsFormatter<&Self>) {
            f.column("a", |&s| cell!("{:.2}", s.a).right());
            f.column("b", |&s| cell!("{:.3}", s.b).right());
        }
    }

    let mut g = Grid::new();
    g.push(&RowData { a: 1.10, b: 1.11 });
    g.push(&RowData { a: 1.00, b: 0.10 });

    print!("{}", g);

    panic!("failed");
}