blob: 5f231ccd8c5064f3c0d91939fbd63c3600a8c463 [file] [log] [blame]
//! This example demonstrates creating a [`CompactTable`] `from()` a
//! multidimensional array.
//!
//! * Note how [`CompactTable::from()`] inherits the lengths of the nested arrays
//! as typed definitions through [const generics](https://practice.rs/generics-traits/const-generics.html).
use tabled::{settings::Style, tables::CompactTable};
fn main() {
let data = [
["Debian", "1.1.1.1", "true"],
["Arch", "127.1.1.1", "true"],
["Manjaro", "Arch", "true"],
];
let _table = CompactTable::from(data).with(Style::psql());
#[cfg(feature = "std")]
println!("{}", _table.to_string());
}