Struct xlsxwriter::worksheet::table::TableOptions
source · 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.