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.
Row split line.