use tabled::{
formatting::{AlignmentStrategy, TrimStrategy},
object::Segment,
Alignment, Modify, Style, TableIteratorExt,
};
fn main() {
let some_json = r#"
[
"foo",
{
"bar": 1,
"baz": [
2,
3
]
}
]"#;
let mut table = [some_json].table();
table
.with(Style::rounded())
.with(Modify::new(Segment::all()).with(Alignment::center()));
println!("A default Alignment settings\n{}", table);
table.with(Modify::new(Segment::all()).with(AlignmentStrategy::PerLine));
println!("Per line Alignment strategy\n{}", table);
table.with(
Modify::new(Segment::all())
.with(AlignmentStrategy::PerCell)
.with(TrimStrategy::Both),
);
println!(
"A default Alignment; allowing vertical and horizontal trim\n{}",
table
);
}