Class: Axlsx::TableStyleElement

Inherits:
Object
  • Object
show all
Includes:
OptionsParser, SerializedAttributes
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

Instance Method Summary collapse

Methods included from SerializedAttributes

#declared_attributes, included, #serialized_attributes, #serialized_element_attributes, #serialized_tag

Methods included from OptionsParser

#parse_options

Constructor Details

#initialize(options = {}) ⇒ TableStyleElement

creates a new TableStyleElement object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • type (Symbol)
  • size (Integer)
  • dxfId (Integer)


12
13
14
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 12

def initialize(options = {})
  parse_options options
end

Instance Attribute Details

#dxfIdInteger

The dxfId this style element points to

Returns:

  • (Integer)


56
57
58
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 56

def dxfId
  @dxfId
end

#sizeInteger

Number of rows or columns used in striping when the type is firstRowStripe, secondRowStripe, firstColumnStripe, or secondColumnStripe.

Returns:

  • (Integer)


52
53
54
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 52

def size
  @size
end

#typeSymbol

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

Returns:

  • (Symbol)


48
49
50
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 48

def type
  @type
end

Instance Method Details

#to_xml_string(str = '') ⇒ String

Serializes the object

Parameters:

  • str (String) (defaults to: '')

Returns:

  • (String)


70
71
72
# File 'lib/axlsx/stylesheet/table_style_element.rb', line 70

def to_xml_string(str = '')
  serialized_tag('tableStyleElement', str)
end