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

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

Style is responsible for a look of a Table.

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/  │
    └────┴──────────────┴───────────────────────────┘

Left frame character.

Right frame character.

The header’s top line.

It’s suppose that Self::frame_bottom and Self::split has the same type of Line short or bordered.

The footer’s bottom line.

It’s suppose that Self::frame_top and Self::split has the same type of Line short or bordered.

The header’s bottom line.

Row split line.

Self::frame_top and Self::frame_bottom

Inner split character.

Trait Implementations

The function modifies a Grid object.

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.