Struct tui::widgets::Table[][src]

pub struct Table<'a, T, H, I, D, R> where
    T: Display,
    H: Iterator<Item = T>,
    I: Display,
    D: Iterator<Item = I>,
    R: Iterator<Item = Row<D, I>>, 
{ /* fields omitted */ }

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(&[5, 5, 10])
    .style(Style::default().fg(Color::White))
    .column_spacing(1);

Methods

impl<'a, T, H, I, D, R> Table<'a, T, H, I, D, R> where
    T: Display,
    H: Iterator<Item = T>,
    I: Display,
    D: Iterator<Item = I>,
    R: Iterator<Item = Row<D, I>>, 
[src]

Trait Implementations

impl<'a, T, H, I, D, R> Default for Table<'a, T, H, I, D, R> where
    T: Display,
    H: Iterator<Item = T> + Default,
    I: Display,
    D: Iterator<Item = I>,
    R: Iterator<Item = Row<D, I>> + Default
[src]

Returns the "default value" for a type. Read more

impl<'a, T, H, I, D, R> Widget for Table<'a, T, H, I, D, R> where
    T: Display,
    H: Iterator<Item = T>,
    I: Display,
    D: Iterator<Item = I>,
    R: Iterator<Item = Row<D, I>>, 
[src]

Draws the current state of the widget in the given buffer. That the only method required to implement a custom widget. Read more

Helper method to quickly set the background of all cells inside the specified area.

Helper method that can be chained with a widget's builder methods to render it.

Auto Trait Implementations

impl<'a, T, H, I, D, R> Send for Table<'a, T, H, I, D, R> where
    H: Send,
    R: Send

impl<'a, T, H, I, D, R> Sync for Table<'a, T, H, I, D, R> where
    H: Sync,
    R: Sync