@param worksheet Pointer to a lxw_worksheet instance to be updated.
@param row The zero indexed row number.
@param height The row height.
@param format A pointer to a Format instance or NULL.
The %worksheet_set_row() function is used to change the default
properties of a row. The most common use for this function is to change the
height of a row:
@code
// Set the height of Row 1 to 20.
worksheet_set_row(worksheet, 0, 20, NULL);
@endcode
The other common use for %worksheet_set_row() is to set the a @ref
format.h "Format" for all cells in the row:
// Set the header row to bold.
worksheet_set_row(worksheet, 0, 15, bold);
@endcode
If you wish to set the format of a row without changing the height you can
pass the default row height of #LXW_DEF_ROW_HEIGHT = 15:
@code
worksheet_set_row(worksheet, 0, LXW_DEF_ROW_HEIGHT, format);
worksheet_set_row(worksheet, 0, 15, format); // Same as above.
@endcode
The format parameter will be applied to any cells in the row that don't
have a format. As with Excel the row format is overridden by an explicit
cell format. For example:
@code
// Row 1 has format1.
worksheet_set_row(worksheet, 0, 15, format1);
// Cell A1 in Row 1 defaults to format1.
worksheet_write_string(worksheet, 0, 0, "Hello", NULL);
@brief Set the properties for a row of cells.
@param worksheet Pointer to a lxw_worksheet instance to be updated. @param row The zero indexed row number. @param height The row height. @param format A pointer to a Format instance or NULL.
The %worksheet_set_row() function is used to change the default properties of a row. The most common use for this function is to change the height of a row:
@code // Set the height of Row 1 to 20. worksheet_set_row(worksheet, 0, 20, NULL); @endcode
The other common use for %worksheet_set_row() is to set the a @ref format.h "Format" for all cells in the row:
@code lxw_format *bold = workbook_add_format(workbook); format_set_bold(bold);
// Set the header row to bold. worksheet_set_row(worksheet, 0, 15, bold); @endcode
If you wish to set the format of a row without changing the height you can pass the default row height of #LXW_DEF_ROW_HEIGHT = 15:
@code worksheet_set_row(worksheet, 0, LXW_DEF_ROW_HEIGHT, format); worksheet_set_row(worksheet, 0, 15, format); // Same as above. @endcode
The format parameter will be applied to any cells in the row that don't have a format. As with Excel the row format is overridden by an explicit cell format. For example:
@code // Row 1 has format1. worksheet_set_row(worksheet, 0, 15, format1);
// Cell A1 in Row 1 defaults to format1. worksheet_write_string(worksheet, 0, 0, "Hello", NULL);
// Cell B1 in Row 1 keeps format2. worksheet_write_string(worksheet, 0, 1, "Hello", format2); @endcode