#[macro_use] extern crate prettytable;
use prettytable::format;
fn main() {
let mut table = table!(["Value 1", "Value 2"], ["Value three", "Value four"]);
table.set_titles(row!["Title 1", "Title 2"]);
println!("FORMAT_NO_LINESEP_WITH_TITLE :");
table.set_format(*format::consts::FORMAT_NO_LINESEP_WITH_TITLE);
table.printstd();
println!("");
println!("FORMAT_NO_COLSEP :");
table.set_format(*format::consts::FORMAT_NO_COLSEP);
table.printstd();
println!("");
println!("FORMAT_BORDERS_ONLY :");
table.set_format(*format::consts::FORMAT_BORDERS_ONLY);
table.printstd();
println!("");
println!("Custom :");
table.set_format(
format::FormatBuilder::new()
.column_separator('|')
.borders('|')
.separators(
&[format::LinePosition::Top, format::LinePosition::Bottom],
format::LineSeparator::new('-', '+', '+', '+')
)
.padding(1, 1)
.build()
);
table.printstd();
}