libxlsxwriter
|
Worksheet table options. More...
Options used to define worksheet tables. See Working with Worksheet Tables for more information.
Data Fields | |
const char * | name |
uint8_t | no_header_row |
uint8_t | no_autofilter |
uint8_t | no_banded_rows |
uint8_t | banded_columns |
uint8_t | first_column |
uint8_t | last_column |
uint8_t | style_type |
uint8_t | style_type_number |
uint8_t | total_row |
lxw_table_column ** | columns |
const char* lxw_table_options::name |
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 on [Naming an Excel Table] (https://support.microsoft.com/en-us/office/rename-an-excel-table-fbf49a4f-82a3-43eb-8ba2-44d21233b114).
uint8_t lxw_table_options::no_header_row |
The no_header_row
parameter can be used to turn off the header row in the table. It is on by default:
Without this option the header row will contain default captions such as Column 1
, Column 2
, etc. These captions can be overridden using the columns
parameter shown below.
uint8_t lxw_table_options::no_autofilter |
The no_autofilter
parameter can be used to turn off the autofilter in the header row. It is on by default:
The autofilter is only shown if the no_header_row
parameter is off (the default). Filter conditions within the table are not supported.
uint8_t lxw_table_options::no_banded_rows |
The no_banded_rows
parameter can be used to turn off the rows of alternating color in the table. It is on by default:
uint8_t lxw_table_options::banded_columns |
The banded_columns
parameter can be used to used to create columns of alternating color in the table. It is off by default:
The banded columns formatting is shown in the image in the previous section above.
uint8_t lxw_table_options::first_column |
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:
uint8_t lxw_table_options::last_column |
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:
The last_column
formatting is shown in the image in the previous section above.
uint8_t lxw_table_options::style_type |
The style_type
parameter can be used to set the style of the table, in conjunction with the style_type_number
parameter:
There are three types of table style in Excel: Light, Medium and Dark which are represented using the lxw_table_style_type enum values:
Within those ranges there are between 11 and 28 other style types which can be set with style_type_number
(depending on the style type). Check Excel to find the style that you want. The dialog with the options laid out in numeric order are shown below:
The default table style in Excel is 'Table Style Medium 9' (highlighted with a green border in the image above), which is set by default in libxlsxwriter as:
You can also turn the table style off by setting it to Light 0:
uint8_t lxw_table_options::style_type_number |
The style_type_number
parameter is used with style_type
to set the style of a worksheet table.
uint8_t lxw_table_options::total_row |
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:
The default total row doesn't have any captions or functions. These must by specified via the columns
parameter below.
lxw_table_column** lxw_table_options::columns |
The columns
parameter can be used to set properties for columns within the table. See Parameter: columns for a detailed explanation.