From 282eec44ef01746ee25931fa6cd287ad083fd40b Mon Sep 17 00:00:00 2001 From: Zsolt Kozaroczy Date: Fri, 11 Sep 2020 00:36:29 +0200 Subject: Restructure examples folder (#47) Split examples into separate markdown files, each containing a description, sample code, and a screenshot of the resulting xlsx document. The script `generate.rb` is provided to actually generate the example documents by executing the sample code contained in the markdown files. --- examples/wrap_text_example.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 examples/wrap_text_example.md (limited to 'examples/wrap_text_example.md') diff --git a/examples/wrap_text_example.md b/examples/wrap_text_example.md new file mode 100644 index 00000000..caa75b17 --- /dev/null +++ b/examples/wrap_text_example.md @@ -0,0 +1,26 @@ +## Description + +Set text wrapping from the styles + +## Code + +```ruby +require 'axlsx' + +p = Axlsx::Package.new +wb = p.workbook +s = wb.styles + +wrap_text = s.add_style alignment: { wrap_text: true } + +wb.add_worksheet(name: 'Wrap Text') do |sheet| + sheet.add_row ['First, Second and Third'], style: wrap_text + sheet.column_widths 9 +end + +p.serialize 'wrap_text_example.xlsx' +``` + +## Output + +![Output](images/wrap_text_example.png "Output") -- cgit v1.2.3