Struct tabled::style::Style[][src]

pub struct Style { /* fields omitted */ }
Expand description

Style is responsible for a look of a table.

It’s suppose to take only 1 type of Lines short or bordered.

Example

    use tabled::{Table, Style, style::Line};
    let data = vec!["Hello", "2021"];
    let table = Table::new(&data).with(
                    Style::noborder()
                        .frame_bottom(Some(Line::short('*', ' ')))
                        .split(Some(Line::short('*', ' ')))
                        .inner(' ')
                )
                .to_string();

    println!("{}", table);

Implementations

Default style looks like the following table

    +----+--------------+---------------------------+
    | id | destribution |           link            |
    +----+--------------+---------------------------+
    | 0  |    Fedora    |  https://getfedora.org/   |
    +----+--------------+---------------------------+
    | 2  |   OpenSUSE   | https://www.opensuse.org/ |
    +----+--------------+---------------------------+
    | 3  | Endeavouros  | https://endeavouros.com/  |
    +----+--------------+---------------------------+

Noborder style looks like the following table

     id   destribution             link
     0       Fedora       https://getfedora.org/
     2      OpenSUSE     https://www.opensuse.org/
     3    Endeavouros    https://endeavouros.com/

Psql style looks like the following table

     id | destribution |           link
    ----+--------------+---------------------------
     0  |    Fedora    |  https://getfedora.org/
     2  |   OpenSUSE   | https://www.opensuse.org/
     3  | Endeavouros  | https://endeavouros.com/

Github_markdown style looks like the following table

    | id | destribution |           link            |
    |----+--------------+---------------------------|
    | 0  |    Fedora    |  https://getfedora.org/   |
    | 2  |   OpenSUSE   | https://www.opensuse.org/ |
    | 3  | Endeavouros  | https://endeavouros.com/  |

Pseudo style looks like the following table

    ┌────┬──────────────┬───────────────────────────┐
    │ id │ destribution │           link            │
    ├────┼──────────────┼───────────────────────────┤
    │ 0  │    Fedora    │  https://getfedora.org/   │
    ├────┼──────────────┼───────────────────────────┤
    │ 2  │   OpenSUSE   │ https://www.opensuse.org/ │
    ├────┼──────────────┼───────────────────────────┤
    │ 3  │ Endeavouros  │ https://endeavouros.com/  │
    └────┴──────────────┴───────────────────────────┘

Pseudo_clean style looks like the following table

    ┌────┬──────────────┬───────────────────────────┐
    │ id │ destribution │           link            │
    ├────┼──────────────┼───────────────────────────┤
    │ 0  │    Fedora    │  https://getfedora.org/   │
    │ 2  │   OpenSUSE   │ https://www.opensuse.org/ │
    │ 3  │ Endeavouros  │ https://endeavouros.com/  │
    └────┴──────────────┴───────────────────────────┘

Trait Implementations

Modification function of a Grid

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.

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.