1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
fn main() {
    use text_grid::*;
    struct RowData {
        a: u32,
        b_1: u32,
        b_2: u32,
    }
    impl CellsSource for RowData {
        fn fmt(f: &mut CellsFormatter<&Self>) {
            f.column("a", |s| s.a);
            f.column_with("b", |f| {
                f.content(|s| s.b_1);
                f.content(|_| " ");
                f.content(|s| s.b_2);
            });
        }
    }

    let mut g = Grid::new();
    g.push(&RowData {
        a: 300,
        b_1: 10,
        b_2: 20,
    });
    g.push(&RowData {
        a: 300,
        b_1: 1,
        b_2: 500,
    });

    print!("{}", g);
}