-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text orientation/rotation #110
Comments
You should be able to do that by assigning a style to the cell: p = Axlsx::Package.new
wb = p.workbook
ws = wb.add_worksheet
cell_rotated_text_style = wb.styles.add_style(:alignment => {:textRotation => 90})
ws.add_row(
["Short cell", "My long title which should be rotated"],
:style => [nil, cell_rotated_text_style]
) |
Thank you very much. That worked perfectly for the whole row. |
Ok, I've just found out how can you do it. For instance, if you want to apply the new style for cells [0,..,2] of rows[0,..,.2] you could do: ws.rows[0..2].each {|row| row.cells[(0..2)].each {|cell| cell.style = cell_rotated_text_style} } Taken from issue: #16 Thanks |
thanks @JonathanTron! |
Is there a way to change vertical/horizontal of text within the cells?. Otherwise, it would be nice to be able to assign a given rotation for text. My problem is that I have 'column header names' that are really long, but each of the column values are 2 digit numbers, so the column width expands too much. I would like to display the header with vertical orientation, and the rest of the column values as usual.
Thanks for your help
The text was updated successfully, but these errors were encountered: