pub struct TableCell {
pub text: String,
pub col_span: u16,
pub row_span: u16,
pub alignment: TextAlign,
pub borders: CellBorders,
pub background: Option<RgbColor>,
pub vertical_align: VerticalAlign,
pub padding: CellPadding,
pub style_ref: Option<String>,
pub nested_table: Option<Box<Table>>,
}Expand description
A single cell in a table row.
Fields§
§text: String§col_span: u16Number of columns this cell spans (default: 1).
row_span: u16Number of rows this cell spans (default: 1).
alignment: TextAlignText alignment within this cell (default: Left).
borders: CellBordersPer-edge borders. If empty, uses the table-level default borders.
background: Option<RgbColor>Background fill override for this cell.
vertical_align: VerticalAlignVertical alignment of text within the cell.
padding: CellPaddingCell padding (insets). Defaults to 1 mm top/bottom, 2 mm left/right.
style_ref: Option<String>Named paragraph style for the cell text.
nested_table: Option<Box<Table>>Optional nested table. When set, renders a sub-table instead of text.
Implementations§
Source§impl TableCell
impl TableCell
pub fn new(text: impl Into<String>) -> Self
Sourcepub fn nested_table(self, table: Table) -> Self
pub fn nested_table(self, table: Table) -> Self
Sets a nested sub-table as the cell content (instead of text).
pub fn padding(self, padding: CellPadding) -> Self
pub fn col_span(self, n: u16) -> Self
pub fn row_span(self, n: u16) -> Self
pub fn align(self, alignment: TextAlign) -> Self
pub fn background(self, color: RgbColor) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TableCell
impl<'de> Deserialize<'de> for TableCell
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TableCell
impl RefUnwindSafe for TableCell
impl Send for TableCell
impl Sync for TableCell
impl Unpin for TableCell
impl UnsafeUnpin for TableCell
impl UnwindSafe for TableCell
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.