pub struct Table {
pub theme: Option<TableThemePartial>,
pub column_widths: Option<Vec<Size>>,
pub children: Vec<Element>,
/* private fields */
}Expand description
A table component with rows and columns.
§Example
fn app() -> impl IntoElement {
Table::new()
.child(TableRow::new().child("Header 1").child("Header 2"))
.child(TableRow::new().child("Data 1").child("Data 2"))
.child(TableRow::new().child("Data 3").child("Data 4"))
}See the interactive components demo.
Fields§
§theme: Option<TableThemePartial>§column_widths: Option<Vec<Size>>§children: Vec<Element>Implementations§
Source§impl Table
impl Table
pub fn new() -> Self
pub fn theme(self, theme: TableThemePartial) -> Self
Sourcepub fn column_widths(self, widths: impl Into<Vec<Size>>) -> Self
pub fn column_widths(self, widths: impl Into<Vec<Size>>) -> Self
Set custom widths for each column.
Accepts any Size, defaults to Size::Flex.
Trait Implementations§
Source§impl ChildrenExt for Table
impl ChildrenExt for Table
Source§fn children_mut(&mut self) -> &mut Vec<Element>
fn children_mut(&mut self) -> &mut Vec<Element>
Returns a mutable reference to the internal children vector. Read more
Source§fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Self
fn children(self, children: impl IntoIterator<Item = impl IntoElement>) -> Self
Extends the children with an iterable of anything that implements
IntoElement. Read moreSource§fn maybe_child<C>(self, child: Option<C>) -> Selfwhere
C: IntoElement,
fn maybe_child<C>(self, child: Option<C>) -> Selfwhere
C: IntoElement,
Source§fn child<C>(self, child: C) -> Selfwhere
C: IntoElement,
fn child<C>(self, child: C) -> Selfwhere
C: IntoElement,
Appends a single child element. Read more
Source§impl Component for Table
impl Component for Table
fn render(&self) -> impl IntoElement
fn render_key(&self) -> DiffKey
Source§impl ContainerExt for Table
impl ContainerExt for Table
Source§impl LayoutExt for Table
impl LayoutExt for Table
Source§fn layout_mut(&mut self) -> &mut LayoutData
fn layout_mut(&mut self) -> &mut LayoutData
Returns a mutable reference to the element’s layout data.
Source§fn layout(self, layout: LayoutData) -> Self
fn layout(self, layout: LayoutData) -> Self
Replace all of the element’s layout data at once. See
LayoutData.impl StructuralPartialEq for Table
Source§impl TableThemePartialExt for Table
impl TableThemePartialExt for Table
fn background(self, background: impl Into<Color>) -> Self
fn hover_row_background(self, hover_row_background: impl Into<Color>) -> Self
fn row_background(self, row_background: impl Into<Color>) -> Self
fn divider_fill(self, divider_fill: impl Into<Color>) -> Self
fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
fn color(self, color: impl Into<Color>) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Table
impl !Send for Table
impl !Sync for Table
impl !UnwindSafe for Table
impl Forget for Table
impl Freeze for Table
impl Unpin for Table
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> ComponentKey for Twhere
T: Component,
impl<T> ComponentKey for Twhere
T: Component,
fn default_key(&self) -> DiffKey
Source§impl<T> ComponentProps for T
impl<T> ComponentProps for T
fn changed(&self, other: &(dyn ComponentProps + 'static)) -> bool
Source§impl<T> ContainerConstraintsExt for Twhere
T: ContainerExt,
impl<T> ContainerConstraintsExt for Twhere
T: ContainerExt,
Source§fn min_width(self, minimum_width: impl Into<Size>) -> Self
fn min_width(self, minimum_width: impl Into<Size>) -> Self
Set the minimum width the element can shrink to. See
Size.Source§fn min_height(self, minimum_height: impl Into<Size>) -> Self
fn min_height(self, minimum_height: impl Into<Size>) -> Self
Set the minimum height the element can shrink to. See
Size.Source§fn max_width(self, maximum_width: impl Into<Size>) -> Self
fn max_width(self, maximum_width: impl Into<Size>) -> Self
Set the maximum width the element can grow to. See
Size.Source§fn max_height(self, maximum_height: impl Into<Size>) -> Self
fn max_height(self, maximum_height: impl Into<Size>) -> Self
Set the maximum height the element can grow to. See
Size.Source§fn visible_width(self, visible_width: impl Into<VisibleSize>) -> Self
fn visible_width(self, visible_width: impl Into<VisibleSize>) -> Self
Set how much of the measured width is actually used in layout. See
VisibleSize.Source§fn visible_height(self, visible_height: impl Into<VisibleSize>) -> Self
fn visible_height(self, visible_height: impl Into<VisibleSize>) -> Self
Set how much of the measured height is actually used in layout. See
VisibleSize.Source§impl<T> ContainerPositionExt for Twhere
T: ContainerExt,
impl<T> ContainerPositionExt for Twhere
T: ContainerExt,
Source§impl<T> ContainerSizeExt for Twhere
T: ContainerExt,
impl<T> ContainerSizeExt for Twhere
T: ContainerExt,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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