summaryrefslogtreecommitdiffhomepage
path: root/examples/example.rb
diff options
context:
space:
mode:
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 15d34ed6..72066140 100755
--- a/examples/example.rb
+++ b/examples/example.rb
@@ -51,6 +51,7 @@ examples << :no_autowidth
examples << :cached_formula
examples << :page_breaks
examples << :rich_text
+examples << :tab_color
p = Axlsx::Package.new
wb = p.workbook
@@ -676,7 +677,7 @@ end
## Book Views
#
-## Book views let you specify which sheet the show as active when the user opens the work book as well as a bunch of other
+## Book views let you specify which sheet the show as active when the user opens the work book as well as a bunch of other
## tuning values for the UI @see Axlsx::WorkbookView
## ```ruby
if examples.include? :book_view
@@ -843,3 +844,18 @@ if examples.include? :rich_text
p.serialize 'rich_text.xlsx'
end
#```
+
+##Change tab color of sheet
+
+#```ruby
+if examples.include? :tab_color
+ p = Axlsx::Package.new
+ p.use_shared_strings = true
+ wb = p.workbook
+ wb.add_worksheet(:name => "Change Tab Color") do |sheet|
+ sheet.add_row ["Check", "out", "the", "Tab Color", "below!"]
+ sheet.sheet_pr.tab_color = "FFFF6666"
+ end
+ p.serialize 'tab_color.xlsx'
+end
+##```