pub struct Table {
pub rows: Vec<Row>,
pub style: TableStyle,
pub column_widths: Option<Vec<ColumnWidth>>,
pub total_width: Option<f32>,
pub header_rows: usize,
}Expand description
Represents a table with rows and styling
Fields§
§rows: Vec<Row>§style: TableStyle§column_widths: Option<Vec<ColumnWidth>>Column width specifications
total_width: Option<f32>Total table width (if None, auto-calculate based on content)
header_rows: usizeNumber of header rows to repeat on each page when paginating
Implementations§
Source§impl Table
impl Table
Sourcepub fn with_style(self, style: TableStyle) -> Self
pub fn with_style(self, style: TableStyle) -> Self
Set the table style
Sourcepub fn with_column_widths(self, widths: Vec<ColumnWidth>) -> Self
pub fn with_column_widths(self, widths: Vec<ColumnWidth>) -> Self
Set column width specifications
Sourcepub fn with_total_width(self, width: f32) -> Self
pub fn with_total_width(self, width: f32) -> Self
Set total table width
Sourcepub fn with_pixel_widths(self, widths: Vec<f32>) -> Self
pub fn with_pixel_widths(self, widths: Vec<f32>) -> Self
Convenience method to set pixel widths for all columns
Sourcepub fn with_border(self, width: f32) -> Self
pub fn with_border(self, width: f32) -> Self
Set border width for the entire table
Sourcepub fn with_header_rows(self, count: usize) -> Self
pub fn with_header_rows(self, count: usize) -> Self
Set the number of header rows to repeat on each page
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get the number of columns (based on the first row, accounting for colspan)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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