- format_set_align
void format_set_align(lxw_format* format, uint8_t alignment)
@brief Set the alignment for data in the cell.
- format_set_bg_color
void format_set_bg_color(lxw_format* format, lxw_color_t color)
@brief Set the pattern background color for a cell.
- format_set_bold
void format_set_bold(lxw_format* format)
@brief Turn on bold for the format font.
- format_set_border
void format_set_border(lxw_format* format, uint8_t style)
@brief Set the cell border style.
- format_set_border_color
void format_set_border_color(lxw_format* format, lxw_color_t color)
@brief Set the color of the cell border.
- format_set_bottom
void format_set_bottom(lxw_format* format, uint8_t style)
@brief Set the cell bottom border style.
- format_set_bottom_color
void format_set_bottom_color(lxw_format* format, lxw_color_t color)
@brief Set the color of the bottom cell border.
- format_set_diag_border
void format_set_diag_border(lxw_format* format, uint8_t value)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_diag_color
void format_set_diag_color(lxw_format* format, lxw_color_t color)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_diag_type
void format_set_diag_type(lxw_format* format, uint8_t value)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_fg_color
void format_set_fg_color(lxw_format* format, lxw_color_t color)
@brief Set the pattern foreground color for a cell.
- format_set_font_charset
void format_set_font_charset(lxw_format* format, uint8_t value)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_font_color
void format_set_font_color(lxw_format* format, lxw_color_t color)
@brief Set the color of the font used in the cell.
- format_set_font_condense
void format_set_font_condense(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_font_extend
void format_set_font_extend(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_font_family
void format_set_font_family(lxw_format* format, uint8_t value)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_font_name
void format_set_font_name(lxw_format* format, char* font_name)
@brief Set the font used in the cell.
- format_set_font_outline
void format_set_font_outline(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_font_scheme
void format_set_font_scheme(lxw_format* format, char* font_scheme)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_font_script
void format_set_font_script(lxw_format* format, uint8_t style)
@brief Set the superscript/subscript property of the font.
- format_set_font_shadow
void format_set_font_shadow(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_font_size
void format_set_font_size(lxw_format* format, uint16_t size)
@brief Set the size of the font used in the cell.
- format_set_font_strikeout
void format_set_font_strikeout(lxw_format* format)
@brief Set the strikeout property of the font.
- format_set_hidden
void format_set_hidden(lxw_format* format)
@brief Hide formulas in a cell.
- format_set_indent
void format_set_indent(lxw_format* format, uint8_t level)
@brief Set the cell text indentation level.
- format_set_italic
void format_set_italic(lxw_format* format)
@brief Turn on italic for the format font.
- format_set_left
void format_set_left(lxw_format* format, uint8_t style)
@brief Set the cell left border style.
- format_set_left_color
void format_set_left_color(lxw_format* format, lxw_color_t color)
@brief Set the color of the left cell border.
- format_set_num_format
void format_set_num_format(lxw_format* format, char* num_format)
@brief Set the number format for a cell.
- format_set_num_format_index
void format_set_num_format_index(lxw_format* format, uint8_t index)
@brief Set the Excel built-in number format for a cell.
- format_set_pattern
void format_set_pattern(lxw_format* format, uint8_t index)
@brief Set the background fill pattern for a cell
- format_set_reading_order
void format_set_reading_order(lxw_format* format, uint8_t value)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_right
void format_set_right(lxw_format* format, uint8_t style)
@brief Set the cell right border style.
- format_set_right_color
void format_set_right_color(lxw_format* format, lxw_color_t color)
@brief Set the color of the right cell border.
- format_set_rotation
void format_set_rotation(lxw_format* format, int16_t angle)
@brief Set the rotation of the text in a cell.
- format_set_shrink
void format_set_shrink(lxw_format* format)
@brief Turn on the text "shrink to fit" for a cell.
- format_set_text_wrap
void format_set_text_wrap(lxw_format* format)
@brief Wrap text in a cell.
- format_set_theme
void format_set_theme(lxw_format* format, uint8_t value)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- format_set_top
void format_set_top(lxw_format* format, uint8_t style)
@brief Set the cell top border style.
- format_set_top_color
void format_set_top_color(lxw_format* format, lxw_color_t color)
@brief Set the color of the top cell border.
- format_set_underline
void format_set_underline(lxw_format* format, uint8_t style)
@brief Turn on underline for the format:
- format_set_unlocked
void format_set_unlocked(lxw_format* format)
@brief Set the cell unlocked state.
- lxw_format_free
void lxw_format_free(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- lxw_format_get_border_key
lxw_border* lxw_format_get_border_key(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- lxw_format_get_fill_key
lxw_fill* lxw_format_get_fill_key(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- lxw_format_get_font_key
lxw_font* lxw_format_get_font_key(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- lxw_format_get_xf_index
int32_t lxw_format_get_xf_index(lxw_format* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- lxw_format_new
lxw_format* lxw_format_new()
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
@page format_page The Format object
The Format object represents an the formatting properties that can be applied to a cell including: fonts, colors, patterns, borders, alignment and number formatting.
See @ref format.h for full details of the functionality.
@file format.h
@brief Functions and properties for adding formatting to cells in Excel.
This section describes the functions and properties that are available for formatting cells in Excel.
The properties of a cell that can be formatted include: fonts, colors, patterns, borders, alignment and number formatting.
@image html formats_intro.png
Formats in libxlsxwriter are accessed via the lxw_format struct. Throughout this document these will be referred to simply as *Formats*.
Formats are created by calling the workbook_add_format() method as follows:
@code lxw_format *format = workbook_add_format(workbook); @endcode
The members of the lxw_format struct aren't modified directly. Instead the format properties are set by calling the functions shown in this section. For example:
@code // Create the Format. lxw_format *format = workbook_add_format(workbook);
// Set some of the format properties. format_set_bold(format); format_set_font_color(format, LXW_COLOR_RED);
// Use the format to change the text format in a cell. worksheet_write_string(worksheet, 0, 0, "Hello", format);
@endcode
The full range of formatting options that can be applied using libxlsxwriter are shown below.