pub struct Table { /* private fields */ }Expand description
Represents a simple table in a PDF document
Implementations§
Source§impl Table
impl Table
Sourcepub fn with_equal_columns(num_columns: usize, total_width: f64) -> Self
pub fn with_equal_columns(num_columns: usize, total_width: f64) -> Self
Create a table with equal column widths
Sourcepub fn set_position(&mut self, x: f64, y: f64) -> &mut Self
pub fn set_position(&mut self, x: f64, y: f64) -> &mut Self
Set table position
Sourcepub fn set_options(&mut self, options: TableOptions) -> &mut Self
pub fn set_options(&mut self, options: TableOptions) -> &mut Self
Set table options
Sourcepub fn add_header_row(
&mut self,
cells: Vec<String>,
) -> Result<&mut Self, PdfError>
pub fn add_header_row( &mut self, cells: Vec<String>, ) -> Result<&mut Self, PdfError>
Add a header row
Sourcepub fn add_row_with_alignment(
&mut self,
cells: Vec<String>,
align: TextAlign,
) -> Result<&mut Self, PdfError>
pub fn add_row_with_alignment( &mut self, cells: Vec<String>, align: TextAlign, ) -> Result<&mut Self, PdfError>
Add a data row with specific alignment
Sourcepub fn add_custom_row(
&mut self,
cells: Vec<TableCell>,
) -> Result<&mut Self, PdfError>
pub fn add_custom_row( &mut self, cells: Vec<TableCell>, ) -> Result<&mut Self, PdfError>
Add a row with custom cells (allows colspan)
Sourcepub fn get_height(&self) -> f64
pub fn get_height(&self) -> f64
Get total table height
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