pub struct TableOptions {
    pub name: Option<String>,
    pub no_header_row: bool,
    pub no_autofilter: bool,
    pub no_banded_rows: bool,
    pub banded_columns: bool,
    pub first_column: bool,
    pub last_column: bool,
    pub style_type: TableStyleType,
    pub style_type_number: u8,
    pub total_row: bool,
    pub columns: Option<Vec<TableColumn>>,
}
Expand description

Options used to define worksheet tables.

worksheet.write_string(0, 0, "header 1", None)?;
worksheet.write_string(0, 1, "header 2", None)?;
worksheet.write_string(1, 0, "content 1", None)?;
worksheet.write_number(1, 1, 1.0, None)?;
worksheet.write_string(2, 0, "content 2", None)?;
worksheet.write_number(2, 1, 2.0, None)?;
worksheet.write_string(3, 0, "content 3", None)?;
worksheet.write_number(3, 1, 3.0, None)?;
worksheet.add_table(0, 0, 3, 1, None)?;

Fields§

§name: Option<String>

The name parameter is used to set the name of the table. This parameter is optional and by default tables are named Table1, Table2, etc. in the worksheet order that they are added. If you override the table name you must ensure that it doesn’t clash with an existing table name and that it follows Excel’s requirements for table names, see the Microsoft Office documentation.

§no_header_row: bool

The no_header_row parameter can be used to turn off the header row in the table. It is on by default.

§no_autofilter: bool

The no_autofilter parameter can be used to turn off the autofilter in the header row. It is on by default.

§no_banded_rows: bool

The no_banded_rows parameter can be used to turn off the rows of alternating color in the table. It is on by default.

§banded_columns: bool

The banded_columns parameter can be used to used to create columns of alternating color in the table. It is off by default.

§first_column: bool

The first_column parameter can be used to highlight the first column of the table. The type of highlighting will depend on the style_type of the table. It may be bold text or a different color. It is off by default.

§last_column: bool

The last_column parameter can be used to highlight the last column of the table. The type of highlighting will depend on the style of the table. It may be bold text or a different color. It is off by default.

§style_type: TableStyleType

The style_type parameter can be used to set the style of the table, in conjunction with the style_type_number parameter.

§style_type_number: u8

The style_type_number parameter is used with style_type to set the style of a worksheet table.

§total_row: bool

The total_row parameter can be used to turn on the total row in the last row of a table. It is distinguished from the other rows by a different formatting and also with dropdown SUBTOTAL functions.

§columns: Option<Vec<TableColumn>>

The columns parameter can be used to set properties for columns within the table.

Trait Implementations§

source§

impl Default for TableOptions

source§

fn default() -> TableOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.