Created
October 8, 2013 01:50
-
-
Save niallsmart/6878157 to your computer and use it in GitHub Desktop.
Axlsx line break
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'axlsx' | |
Axlsx::Package.new do |package| | |
workbook = package.workbook | |
workbook.add_worksheet do |sheet| | |
wrap = workbook.styles.add_style alignment: {wrap_text: true} | |
sheet.add_row ["Foo\r\nBar", "Foo\rBar", "Foo\nBar", "Foo\n\r\nBar"], style: wrap | |
end | |
package.serialize "linebreak.xlsx" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Re: Mac OSX, please note it's
use_shared_strings
(with an S at then end), notuse_shared_string
.