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<S: AsRef<str>>(column: usize, text: S) -> VerticalPanel<S>
pub fn vertical<S: AsRef<str>>(column: usize, text: S) -> VerticalPanel<S>
Creates an empty vertical row at given index.
use tabled::{settings::Panel, Table};
let data = [[1, 2, 3], [4, 5, 6]];
let table = Table::new(data)
.with(Panel::vertical(1, "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<S: AsRef<str>>(row: usize, text: S) -> HorizontalPanel<S>
pub fn horizontal<S: AsRef<str>>(row: usize, text: S) -> HorizontalPanel<S>
Creates an empty horizontal row at given index.
use tabled::{Table, settings::Panel};
let data = [[1, 2, 3], [4, 5, 6]];
let table = Table::new(data)
.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