summaryrefslogtreecommitdiffhomepage
path: root/examples/example.rb
diff options
context:
space:
mode:
authorRishi <[email protected]>2014-10-15 16:25:45 -0500
committerRishi <[email protected]>2014-10-15 16:25:45 -0500
commit1174046dfd6294d8928e53cb6e5b56c128f18c2d (patch)
treec10e363b88330cf59240f8ad4242ef49ed510e72 /examples/example.rb
parent7cf747675097be13df633f1b2a5c45391df52b33 (diff)
downloadcaxlsx-1174046dfd6294d8928e53cb6e5b56c128f18c2d.tar.gz
caxlsx-1174046dfd6294d8928e53cb6e5b56c128f18c2d.zip
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.
Diffstat (limited to 'examples/example.rb')
-rwxr-xr-xexamples/example.rb18
1 files changed, 17 insertions, 1 deletions
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
+#```