class OoxmlParser::TableStyle

Style of Table

Attributes

banding_1_horizontal[RW]
banding_1_vertical[RW]
banding_2_horizontal[RW]
banding_2_vertical[RW]
first_column[RW]
first_row[RW]
id[RW]
last_column[RW]
last_row[RW]
name[RW]
northeast_cell[RW]
northwest_cell[RW]
southeast_cell[RW]
southwest_cell[RW]
value[R]

@return [String] value of table style

whole_table[RW]

Public Instance Methods

parse(node) click to toggle source

Parse TableStyle object @param node [Nokogiri::XML:Element] node to parse @return [TableStyle] result of parsing

# File lib/ooxml_parser/common_parser/common_data/table/properties/table_style.rb, line 16
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'styleId'
      @id = value.value.to_s
    when 'styleName'
      @name = value.value.to_s
    when 'val'
      @value = value.value.to_s
    end
  end

  node.xpath('*').each do |style_node_child|
    case style_node_child.name
    when 'wholeTbl'
      @whole_table = TableElement.new(parent: self).parse(style_node_child)
    when 'band1H'
      @banding_1_horizontal = TableElement.new(parent: self).parse(style_node_child)
    when 'band2H', 'band2Horz'
      @banding_2_horizontal = TableElement.new(parent: self).parse(style_node_child)
    when 'band1V'
      @banding_1_vertical = TableElement.new(parent: self).parse(style_node_child)
    when 'band2V'
      @banding_2_vertical = TableElement.new(parent: self).parse(style_node_child)
    when 'lastCol'
      @last_column = TableElement.new(parent: self).parse(style_node_child)
    when 'firstCol'
      @first_column = TableElement.new(parent: self).parse(style_node_child)
    when 'lastRow'
      @last_row = TableElement.new(parent: self).parse(style_node_child)
    when 'firstRow'
      @first_row = TableElement.new(parent: self).parse(style_node_child)
    when 'seCell'
      @southeast_cell = TableElement.new(parent: self).parse(style_node_child)
    when 'swCell'
      @southwest_cell = TableElement.new(parent: self).parse(style_node_child)
    when 'neCell'
      @northeast_cell = TableElement.new(parent: self).parse(style_node_child)
    when 'nwCell'
      @northwest_cell = TableElement.new(parent: self).parse(style_node_child)
    end
  end
  self
end