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 new() -> TableStyle
pub fn new() -> TableStyle
Creates a default table style.
Sourcepub fn header() -> TableStyle
pub fn header() -> TableStyle
Creates a header-only style (bold white text on accent blue).
Sourcepub fn simple() -> TableStyle
pub fn simple() -> TableStyle
Creates a simple style without borders or banding.
Sourcepub fn banded_rows(self, enabled: bool) -> TableStyle
pub fn banded_rows(self, enabled: bool) -> TableStyle
Enables zebra striping.
Sourcepub fn auto_width(self, enabled: bool) -> TableStyle
pub fn auto_width(self, enabled: bool) -> TableStyle
Enables auto column width.
Sourcepub fn borders(self, enabled: bool) -> TableStyle
pub fn borders(self, enabled: bool) -> TableStyle
Enables table borders.
Sourcepub fn header_background(self, color: Color) -> TableStyle
pub fn header_background(self, color: Color) -> TableStyle
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
Source§impl Default for TableStyle
impl Default for TableStyle
Source§fn default() -> TableStyle
fn default() -> TableStyle
Returns the “default value” for a type. Read more
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