Class: Axlsx::TableStyleElement
- Inherits:
-
Object
- Object
- Axlsx::TableStyleElement
- Defined in:
- lib/axlsx/stylesheet/table_style_element.rb
Overview
Note:
tables and table styles are not supported in this version. This class exists in preparation for that support.
an element of style that belongs to a table style.
Instance Attribute Summary collapse
-
#dxfId ⇒ Integer
The dxfId this style element points to.
-
#size ⇒ Integer
Number of rows or columns used in striping when the type is firstRowStripe, secondRowStripe, firstColumnStripe, or secondColumnStripe.
-
#type ⇒ Symbol
The type of style element.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ TableStyleElement
constructor
creates a new TableStyleElement object.
-
#to_xml_string(str = '') ⇒ String
Serializes the object.
Constructor Details
#initialize(options = {}) ⇒ TableStyleElement
creates a new TableStyleElement object
50 51 52 53 54 |
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 50 def initialize(={}) .each do |o| self.send("#{o[0]}=", o[1]) if self.respond_to? o[0] end end |
Instance Attribute Details
#dxfId ⇒ Integer
The dxfId this style element points to
44 45 46 |
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 44 def dxfId @dxfId end |
#size ⇒ Integer
Number of rows or columns used in striping when the type is firstRowStripe, secondRowStripe, firstColumnStripe, or secondColumnStripe.
40 41 42 |
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 40 def size @size end |
#type ⇒ Symbol
The type of style element. The following type are allowed
:wholeTable
:headerRow
:totalRow
:firstColumn
:lastColumn
:firstRowStripe
:secondRowStripe
:firstColumnStripe
:secondColumnStripe
:firstHeaderCell
:lastHeaderCell
:firstTotalCell
:lastTotalCell
:firstSubtotalColumn
:secondSubtotalColumn
:thirdSubtotalColumn
:firstSubtotalRow
:secondSubtotalRow
:thirdSubtotalRow
:blankRow
:firstColumnSubheading
:secondColumnSubheading
:thirdColumnSubheading
:firstRowSubheading
:secondRowSubheading
:thirdRowSubheading
:pageFieldLabels
:pageFieldValues
36 37 38 |
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 36 def type @type end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the object
68 69 70 71 72 |
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 68 def to_xml_string(str = '') str << '<tableStyleElement ' str << instance_values.map { |key, value| '' << key.to_s << '="' << value.to_s << '"' }.join(' ') str << '/>' end |