Expand description
This module contains primitives to create a spread row.
Ultimately it is a cell with a span set to a number of columns on the Table
.
You can use a Span
to set a custom span.
§Example
use tabled::{Table, settings::Panel};
let data = [[1, 2, 3], [4, 5, 6]];
let table = Table::new(data)
.with(Panel::vertical(1, "S\np\nl\ni\nt"))
.with(Panel::header("Numbers"))
.to_string();
println!("{}", table);
assert_eq!(
table,
concat!(
"+---+---+---+---+\n",
"| Numbers |\n",
"+---+---+---+---+\n",
"| 0 | S | 1 | 2 |\n",
"+---+ p +---+---+\n",
"| 1 | l | 2 | 3 |\n",
"+---+ i +---+---+\n",
"| 4 | t | 5 | 6 |\n",
"+---+---+---+---+",
)
)
Structs§
- Footer
- Footer renders a
Panel
at the bottom. SeePanel
. - Header
- Header inserts a
Panel
at the top. SeePanel
. - Horizontal
Panel - A horizontal/column span from 0 to a count rows.
- Panel
- Panel allows to add a Row which has 1 continues Cell to a
Table
. - Vertical
Panel - A vertical/row span from 0 to a count columns.