summaryrefslogtreecommitdiffstats
path: root/vendor/tabled/examples/pool_table2.rs
blob: 02b4572501683d16698012281c24ed45f0c08380 (plain)
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
//! This example demonstrates a [`PoolTable`] usage.

use tabled::{
    settings::{Alignment, Style},
    tables::PoolTable,
};

fn main() {
    let characters = [
        "Naruto Uzumaki",
        "Kakashi Hatake",
        "Minato Namikaze",
        "Jiraiya",
        "Orochimaru",
        "Itachi Uchiha",
    ];

    let data = characters.chunks(2);

    let table = PoolTable::new(data)
        .with(Style::dots())
        .with(Alignment::center())
        .to_string();

    println!("{table}");
}