pub struct TableStyle {
pub header_font: FontConfig,
pub content_font: FontConfig,
pub header_background: Option<Color>,
pub banded_rows: bool,
pub even_row_background: Option<Color>,
pub odd_row_background: Option<Color>,
pub auto_width: bool,
pub borders: bool,
}Expand description
表格级格式化配置。
对应 Java: com.alibaba.excel.write.metadata.style.WriteCellStyle 的表格级属性
Fields§
§header_font: FontConfigStyle for the header row.
content_font: FontConfigStyle for content rows.
header_background: Option<Color>Background color for header cells.
banded_rows: boolWhether to apply alternating row colors (banded/zebra).
even_row_background: Option<Color>Background color for even rows (when banded).
odd_row_background: Option<Color>Background color for odd rows (when banded).
auto_width: boolWhether to auto-fit column widths to content.
borders: boolTable border visibility.
Implementations§
Source§impl TableStyle
impl TableStyle
Sourcepub fn banded_rows(self, enabled: bool) -> Self
pub fn banded_rows(self, enabled: bool) -> Self
Enables zebra striping.
Sourcepub fn auto_width(self, enabled: bool) -> Self
pub fn auto_width(self, enabled: bool) -> Self
Enables auto column width.
Sourcepub fn header_background(self, color: Color) -> Self
pub fn header_background(self, color: Color) -> Self
Sets header background color.
Trait Implementations§
Source§impl Clone for TableStyle
impl Clone for TableStyle
Source§fn clone(&self) -> TableStyle
fn clone(&self) -> TableStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TableStyle
impl Debug for TableStyle
Auto Trait Implementations§
impl Freeze for TableStyle
impl RefUnwindSafe for TableStyle
impl Send for TableStyle
impl Sync for TableStyle
impl Unpin for TableStyle
impl UnsafeUnpin for TableStyle
impl UnwindSafe for TableStyle
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