[GH-ISSUE #182] Question: Change row/column width without changing format #150

Closed
opened 2026-05-05 11:47:20 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @petricf on GitHub (May 23, 2018).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/182

The functions worksheet_set_row and worksheet_set_column allow to change the width and height of the rows/columns.

But they always come with a lxw_format parameter.

The doc is not clear - passing NULL as lxw_format changes the formatting on all rows/columns to default ?
Or does it leave the formatting info as is ?

If the former applies - how to change the row/column size, but let the formatting info unchanged ?

Originally created by @petricf on GitHub (May 23, 2018). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/182 The functions worksheet_set_row and worksheet_set_column allow to change the width and height of the rows/columns. But they always come with a lxw_format parameter. The doc is not clear - passing NULL as lxw_format changes the formatting on all rows/columns to default ? Or does it leave the formatting info as is ? If the former applies - how to change the row/column size, but let the formatting info unchanged ?
Author
Owner

@jmcnamara commented on GitHub (May 23, 2018):

A cell format will override a column or row format.

<!-- gh-comment-id:391530327 --> @jmcnamara commented on GitHub (May 23, 2018): A cell format will override a column or row format.
Author
Owner

@petricf commented on GitHub (May 23, 2018):

But if the worksheet_set_row call comes AFTER a worksheet_write_* - which format parameter takes precedence ?

<!-- gh-comment-id:391539364 --> @petricf commented on GitHub (May 23, 2018): But if the worksheet_set_row call comes AFTER a worksheet_write_* - which format parameter takes precedence ?
Author
Owner

@jmcnamara commented on GitHub (May 24, 2018):

The order doesn’t matter the cell format still takes preference. This is Excel’s rule which is something like Cell > Row > Column.

Excel, the application, creates new formats at the intersection of Cell/Row/Column formats but that isn’t an automatic feature of the file format so libsxwriter users need to create and apply the intersection formats if required.

<!-- gh-comment-id:391602066 --> @jmcnamara commented on GitHub (May 24, 2018): The order doesn’t matter the cell format still takes preference. This is Excel’s rule which is something like Cell > Row > Column. Excel, the application, creates new formats at the intersection of Cell/Row/Column formats but that isn’t an automatic feature of the file format so libsxwriter users need to create and apply the intersection formats if required.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#150
No description provided.