Struct tabled::Table [−][src]
pub struct Table { /* fields omitted */ }
Expand description
Table structure provides an interface for building a table for types that implements Tabled.
To build a string representation of a table you must use a std::fmt::Display.
Or simply call .to_string()
method.
Example
Basic usage
use tabled::Table;
let table = Table::new(&["Year", "2021"]);
With settings
use tabled::{Table, Style, Alignment, Full, Modify};
let data = vec!["Hello", "2021"];
let table = Table::new(&data)
.with(Style::psql())
.with(Modify::new(Full).with(Alignment::left()));
println!("{}", table);
Implementations
New creates a Table instance.
With is a generic function which applies options to the Table.
It applies settings immediately.