pub struct Panel;
Expand description
Panel allows to add a Row which has 1 continues Cell to a Table
.
See examples/panel.rs
.
Implementations§
Source§impl Panel
impl Panel
Sourcepub fn vertical(column: usize) -> VerticalPanel<&'static str>
pub fn vertical(column: usize) -> VerticalPanel<&'static str>
Creates an empty vertical row at given index.
use tabled::{Panel, TableIteratorExt};
let data = [[1, 2, 3], [4, 5, 6]];
let table = data.table()
.with(Panel::vertical(1).text("Tabled Releases"))
.to_string();
println!("{}", table);
assert_eq!(
table,
concat!(
"+---+-----------------+---+---+\n",
"| 0 | Tabled Releases | 1 | 2 |\n",
"+---+ +---+---+\n",
"| 1 | | 2 | 3 |\n",
"+---+ +---+---+\n",
"| 4 | | 5 | 6 |\n",
"+---+-----------------+---+---+",
)
)
Sourcepub fn horizontal(row: usize) -> HorizontalPanel<&'static str>
pub fn horizontal(row: usize) -> HorizontalPanel<&'static str>
Creates an empty horizontal row at given index.
use tabled::{Panel, TableIteratorExt};
let data = [[1, 2, 3], [4, 5, 6]];
let table = data.table()
.with(Panel::vertical(1))
.to_string();
println!("{}", table);
assert_eq!(
table,
concat!(
"+---+--+---+---+\n",
"| 0 | | 1 | 2 |\n",
"+---+ +---+---+\n",
"| 1 | | 2 | 3 |\n",
"+---+ +---+---+\n",
"| 4 | | 5 | 6 |\n",
"+---+--+---+---+",
)
)
Creates an horizontal row at last row.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Panel
impl RefUnwindSafe for Panel
impl Send for Panel
impl Sync for Panel
impl Unpin for Panel
impl UnwindSafe for Panel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more