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 Line
s 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
Auto Trait Implementations
impl RefUnwindSafe for Style
impl UnwindSafe for Style