wide_characters/wide_characters.rs
1use stybulate::*;
2
3fn main() {
4 // Wide characters are handled correctly when computing columns length:
5 let table = Table::new(
6 Style::Grid,
7 vec![
8 vec![Cell::from("Tabulate with style!")],
9 vec![Cell::from("табулировать со стилем!")],
10 vec![Cell::from("スタイルで集計!")],
11 vec![Cell::from("用样式表!")],
12 ],
13 None,
14 );
15 println!("{}", table.tabulate());
16 /* Will print:
17 +-------------------------+
18 | Tabulate with style! |
19 +-------------------------+
20 | табулировать со стилем! |
21 +-------------------------+
22 | スタイルで集計! |
23 +-------------------------+
24 | 用样式表! |
25 +-------------------------+
26 */
27}