pub struct TableProps {
pub striped: bool,
pub striped_columns: bool,
pub hover: bool,
pub bordered: bool,
pub borderless: bool,
pub size: Size,
pub color: Option<Color>,
pub responsive: bool,
pub caption: String,
pub caption_top: bool,
pub class: String,
pub children: Element,
/* private fields */
}Expand description
Bootstrap Table component.
§Bootstrap HTML → Dioxus
<!-- Bootstrap HTML -->
<div class="table-responsive">
<table class="table table-striped table-hover">
<caption>List of users</caption>
<thead><tr><th>Name</th><th>Role</th></tr></thead>
<tbody><tr><td>Alice</td><td>Admin</td></tr></tbody>
</table>
</div>// Dioxus equivalent
rsx! {
Table { striped: true, hover: true, responsive: true,
caption: "List of users", caption_top: true,
thead {
tr { th { "Name" } th { "Role" } }
}
tbody {
tr { td { "Alice" } td { "Admin" } }
}
}
}§Props
striped— striped rowsstriped_columns— striped columns instead of rowshover— highlight rows on hoverbordered— borders on all cellsresponsive— horizontal scroll wrappercaption/caption_top— table caption text and positionsize—Size::Smfor compact tablecolor— table color variant
Fields§
§striped: boolStriped rows.
striped_columns: boolStriped columns instead of rows.
hover: boolHighlight rows on hover.
bordered: boolAdd borders to all cells.
borderless: boolRemove all borders.
size: SizeCompact table with smaller padding.
color: Option<Color>Table color variant.
responsive: boolWrap in a responsive container for horizontal scrolling.
caption: StringCaption text (displayed above or below the table).
caption_top: boolPlace caption at the top (default is bottom per Bootstrap).
class: StringAdditional CSS classes.
children: ElementChild elements (thead, tbody, etc.).
Implementations§
Source§impl TableProps
impl TableProps
Sourcepub fn builder() -> TablePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> TablePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building TableProps.
On the builder, call .striped(...)(optional), .striped_columns(...)(optional), .hover(...)(optional), .bordered(...)(optional), .borderless(...)(optional), .size(...)(optional), .color(...)(optional), .responsive(...)(optional), .caption(...)(optional), .caption_top(...)(optional), .class(...)(optional), .attributes(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TableProps.
Trait Implementations§
Source§impl Clone for TableProps
impl Clone for TableProps
Source§fn clone(&self) -> TableProps
fn clone(&self) -> TableProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more