[−][src]Struct tui::widgets::Table
A widget to display data in formatted columns
Examples
let row_style = Style::default().fg(Color::White); Table::new( ["Col1", "Col2", "Col3"].into_iter(), vec![ Row::StyledData(["Row11", "Row12", "Row13"].into_iter(), row_style), Row::StyledData(["Row21", "Row22", "Row23"].into_iter(), row_style), Row::StyledData(["Row31", "Row32", "Row33"].into_iter(), row_style), Row::Data(["Row41", "Row42", "Row43"].into_iter()) ].into_iter() ) .block(Block::default().title("Table")) .header_style(Style::default().fg(Color::Yellow)) .widths(&[Constraint::Length(5), Constraint::Length(5), Constraint::Length(10)]) .style(Style::default().fg(Color::White)) .column_spacing(1);
Implementations
impl<'a, H, D, R> Table<'a, H, R> where
H: Iterator,
D: Iterator,
D::Item: Display,
R: Iterator<Item = Row<D>>,
[src]
H: Iterator,
D: Iterator,
D::Item: Display,
R: Iterator<Item = Row<D>>,
pub fn new(header: H, rows: R) -> Table<'a, H, R>
[src]
pub fn block(self, block: Block<'a>) -> Table<'a, H, R>
[src]
pub fn header<II>(self, header: II) -> Table<'a, H, R> where
II: IntoIterator<Item = H::Item, IntoIter = H>,
[src]
II: IntoIterator<Item = H::Item, IntoIter = H>,
pub fn header_style(self, style: Style) -> Table<'a, H, R>
[src]
pub fn widths(self, widths: &'a [Constraint]) -> Table<'a, H, R>
[src]
pub fn rows<II>(self, rows: II) -> Table<'a, H, R> where
II: IntoIterator<Item = Row<D>, IntoIter = R>,
[src]
II: IntoIterator<Item = Row<D>, IntoIter = R>,
pub fn style(self, style: Style) -> Table<'a, H, R>
[src]
pub fn highlight_symbol(self, highlight_symbol: &'a str) -> Table<'a, H, R>
[src]
pub fn highlight_style(self, highlight_style: Style) -> Table<'a, H, R>
[src]
pub fn column_spacing(self, spacing: u16) -> Table<'a, H, R>
[src]
pub fn header_gap(self, gap: u16) -> Table<'a, H, R>
[src]
Trait Implementations
impl<'a, H: Clone, R: Clone> Clone for Table<'a, H, R>
[src]
impl<'a, H: Debug, R: Debug> Debug for Table<'a, H, R>
[src]
impl<'a, H, R> Default for Table<'a, H, R> where
H: Iterator + Default,
R: Iterator + Default,
[src]
H: Iterator + Default,
R: Iterator + Default,
impl<'a, H, D, R> StatefulWidget for Table<'a, H, R> where
H: Iterator,
H::Item: Display,
D: Iterator,
D::Item: Display,
R: Iterator<Item = Row<D>>,
[src]
H: Iterator,
H::Item: Display,
D: Iterator,
D::Item: Display,
R: Iterator<Item = Row<D>>,
impl<'a, H, D, R> Widget for Table<'a, H, R> where
H: Iterator,
H::Item: Display,
D: Iterator,
D::Item: Display,
R: Iterator<Item = Row<D>>,
[src]
H: Iterator,
H::Item: Display,
D: Iterator,
D::Item: Display,
R: Iterator<Item = Row<D>>,
Auto Trait Implementations
impl<'a, H, R> RefUnwindSafe for Table<'a, H, R> where
H: RefUnwindSafe,
R: RefUnwindSafe,
H: RefUnwindSafe,
R: RefUnwindSafe,
impl<'a, H, R> Send for Table<'a, H, R> where
H: Send,
R: Send,
H: Send,
R: Send,
impl<'a, H, R> Sync for Table<'a, H, R> where
H: Sync,
R: Sync,
H: Sync,
R: Sync,
impl<'a, H, R> Unpin for Table<'a, H, R> where
H: Unpin,
R: Unpin,
H: Unpin,
R: Unpin,
impl<'a, H, R> UnwindSafe for Table<'a, H, R> where
H: UnwindSafe,
R: UnwindSafe,
H: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,