pub struct Table {
pub states: TableStates,
/* private fields */
}Expand description
Table represents a read-only textual table component which can be scrollable through arrows or inactive.
Fields§
§states: TableStatesImplementations§
Source§impl Table
impl Table
Sourcepub fn foreground(self, fg: Color) -> Self
pub fn foreground(self, fg: Color) -> Self
Set the main foreground color. This may get overwritten by individual text styles.
Sourcepub fn background(self, bg: Color) -> Self
pub fn background(self, bg: Color) -> Self
Set the main background color. This may get overwritten by individual text styles.
Sourcepub fn modifiers(self, m: TextModifiers) -> Self
pub fn modifiers(self, m: TextModifiers) -> Self
Set the main text modifiers. This may get overwritten by individual text styles.
Sourcepub fn style(self, style: Style) -> Self
pub fn style(self, style: Style) -> Self
Set the main style. This may get overwritten by individual text styles.
This option will overwrite any previous foreground, background and modifiers!
Sourcepub fn inactive(self, s: Style) -> Self
pub fn inactive(self, s: Style) -> Self
Set a custom style for the border when the component is unfocused.
Sourcepub fn step(self, step: usize) -> Self
pub fn step(self, step: usize) -> Self
Set the scroll stepping to use on Cmd::Scroll(Direction::Up) or Cmd::Scroll(Direction::Down).
Sourcepub fn scroll(self, scrollable: bool) -> Self
pub fn scroll(self, scrollable: bool) -> Self
Should the list be scrollable or always show only the top (0th) element?
Sourcepub fn highlight_str<S: Into<LineStatic>>(self, s: S) -> Self
pub fn highlight_str<S: Into<LineStatic>>(self, s: S) -> Self
Set the Symbol and Style for the indicator of the current line.
Sourcepub fn highlight_style(self, s: Style) -> Self
pub fn highlight_style(self, s: Style) -> Self
Set a custom highlight style that is patched on-top of the normal style.
By default the highlight style is just Style::new().add_modifier(Modifier::REVERSED).
Sourcepub fn highlight_style_inactive(self, s: Style) -> Self
pub fn highlight_style_inactive(self, s: Style) -> Self
Set a custom highlight style that is patched on-top of the highlight style when unfocused.
Sourcepub fn column_spacing(self, w: u16) -> Self
pub fn column_spacing(self, w: u16) -> Self
Set custom spacing between columns.
Sourcepub fn row_height(self, h: u16) -> Self
pub fn row_height(self, h: u16) -> Self
Set a custom height for all rows.
Default: 1
Sourcepub fn headers<S: Into<String>>(
self,
headers: impl IntoIterator<Item = S>,
) -> Self
pub fn headers<S: Into<String>>( self, headers: impl IntoIterator<Item = S>, ) -> Self
Set headers for columns.
Sourcepub fn rewind(self, r: bool) -> Self
pub fn rewind(self, r: bool) -> Self
Set whether wraparound should be possible (down on the last choice wraps around to 0, and the other way around).
Sourcepub fn selected_line(self, line: usize) -> Self
pub fn selected_line(self, line: usize) -> Self
Set the initially selected line.
Sourcepub fn always_active(self) -> Self
pub fn always_active(self) -> Self
Set the current component to be always active (show highligh even if unfocused)
Trait Implementations§
Source§impl Component for Table
impl Component for Table
Source§fn view(&mut self, render: &mut Frame<'_>, area: Rect)
fn view(&mut self, render: &mut Frame<'_>, area: Rect)
Source§fn query<'a>(&'a self, attr: Attribute) -> Option<QueryResult<'a>>
fn query<'a>(&'a self, attr: Attribute) -> Option<QueryResult<'a>>
Auto Trait Implementations§
impl Freeze for Table
impl !RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl !UnwindSafe for Table
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more