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]
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>>,
pub fn new(header: H, rows: R) -> Table<'a, T, H, I, D, R>
[src]
pub fn new(header: H, rows: R) -> Table<'a, T, H, I, D, R>
pub fn block(self, block: Block<'a>) -> Table<'a, T, H, I, D, R>
[src]
pub fn block(self, block: Block<'a>) -> Table<'a, T, H, I, D, R>
pub fn header<II>(self, header: II) -> Table<'a, T, H, I, D, R> where
II: IntoIterator<Item = T, IntoIter = H>,
[src]
pub fn header<II>(self, header: II) -> Table<'a, T, H, I, D, R> where
II: IntoIterator<Item = T, IntoIter = H>,
pub fn header_style(self, style: Style) -> Table<'a, T, H, I, D, R>
[src]
pub fn header_style(self, style: Style) -> Table<'a, T, H, I, D, R>
pub fn widths(self, widths: &'a [u16]) -> Table<'a, T, H, I, D, R>
[src]
pub fn widths(self, widths: &'a [u16]) -> Table<'a, T, H, I, D, R>
pub fn rows<II>(self, rows: II) -> Table<'a, T, H, I, D, R> where
II: IntoIterator<Item = Row<D, I>, IntoIter = R>,
[src]
pub fn rows<II>(self, rows: II) -> Table<'a, T, H, I, D, R> where
II: IntoIterator<Item = Row<D, I>, IntoIter = R>,
pub fn style(self, style: Style) -> Table<'a, T, H, I, D, R>
[src]
pub fn style(self, style: Style) -> Table<'a, T, H, I, D, R>
pub fn column_spacing(self, spacing: u16) -> Table<'a, T, H, I, D, R>
[src]
pub fn column_spacing(self, spacing: u16) -> Table<'a, T, H, I, D, R>
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]
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,
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]
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>>,
fn draw(&mut self, area: Rect, buf: &mut Buffer)
[src]
fn draw(&mut self, area: Rect, buf: &mut Buffer)
Draws the current state of the widget in the given buffer. That the only method required to implement a custom widget. Read more
fn background(&self, area: &Rect, buf: &mut Buffer, color: Color)
[src]
fn background(&self, area: &Rect, buf: &mut Buffer, color: Color)
Helper method to quickly set the background of all cells inside the specified area.
fn render<B>(&mut self, f: &mut Frame<B>, area: Rect) where
Self: Sized,
B: Backend,
[src]
fn render<B>(&mut self, f: &mut Frame<B>, area: Rect) where
Self: Sized,
B: Backend,
Helper method that can be chained with a widget's builder methods to render it.