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.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.