From 1174046dfd6294d8928e53cb6e5b56c128f18c2d Mon Sep 17 00:00:00 2001 From: Rishi Date: Wed, 15 Oct 2014 16:25:45 -0500 Subject: Added an example of row height An example for changing the row height was missing. I thought it would make sense to have this in example as well. I needed the option and I have to look at the code to how to do it. I think it would help others. --- examples/example.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'examples/example.rb') diff --git a/examples/example.rb b/examples/example.rb index 116ce730..eebfc868 100755 --- a/examples/example.rb +++ b/examples/example.rb @@ -14,6 +14,7 @@ examples << :surrounding_border examples << :deep_custom_borders examples << :row_column_style examples << :fixed_column_width +examples << :height examples << :outline_level examples << :merge_cells examples << :images @@ -246,6 +247,21 @@ if examples.include? :fixed_column_width end end + +##Specifying Row height + +#```ruby +if examples.include? :height + wb.styles do |s| + head = s.add_style :bg_color => "00", :fg_color => "FF" + wb.add_worksheet(:name => "fixed row height") do |sheet| + sheet.add_row ["This row will have a fixed height", "It will overwite the default row height"], :height => 30 + sheet.add_row ["This row can have a different height too"], :height => 10, :style => head + end + end +end + + #```ruby if examples.include? :outline_level wb.add_worksheet(name: 'outline_level') do |sheet| @@ -825,4 +841,4 @@ if examples.include? :rich_text end p.serialize 'rich_text.xlsx' end -#``` \ No newline at end of file +#``` -- cgit v1.2.3