summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/table.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-09-14 17:53:00 +0900
committerRandy Morgan <[email protected]>2012-09-14 17:53:00 +0900
commit3e4ee23a46c12f1a634f2cadee1798b0cb1000ff (patch)
tree49c8d888a2131740c2765d95b96c391fd90078b8 /lib/axlsx/workbook/worksheet/table.rb
parent46a9ee40524b2485155361a728fde7d35d687066 (diff)
downloadcaxlsx-3e4ee23a46c12f1a634f2cadee1798b0cb1000ff.tar.gz
caxlsx-3e4ee23a46c12f1a634f2cadee1798b0cb1000ff.zip
Implement table style info for named tables.
Diffstat (limited to 'lib/axlsx/workbook/worksheet/table.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/table.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/table.rb b/lib/axlsx/workbook/worksheet/table.rb
index b848180b..424bb73b 100644
--- a/lib/axlsx/workbook/worksheet/table.rb
+++ b/lib/axlsx/workbook/worksheet/table.rb
@@ -28,6 +28,7 @@ module Axlsx
@sheet = sheet
@style = nil
@sheet.workbook.tables << self
+ @table_style_info = TableStyleInfo.new(options[:style_info]) if options[:style_info]
@name = "Table#{index+1}"
options.each do |o|
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
@@ -62,6 +63,12 @@ module Axlsx
@name = v
end
end
+
+ # TableStyleInfo for the table.
+ # initialization can be fed via the :style_info option
+ def table_style_info
+ @table_style_info ||= TableStyleInfo.new
+ end
# Serializes the object
# @param [String] str
@@ -77,7 +84,7 @@ module Axlsx
end
str << '</tableColumns>'
#TODO implement tableStyleInfo
- str << '<tableStyleInfo showFirstColumn="0" showLastColumn="0" showRowStripes="1" showColumnStripes="0" name="TableStyleMedium9" />'
+ table_style_info.to_xml_string(str) # '<tableStyleInfo showFirstColumn="0" showLastColumn="0" showRowStripes="1" showColumnStripes="0" name="TableStyleMedium9" />'
str << '</table>'
end