class OoxmlParser::TableStyleInfo

Class for ‘tableStyleInfo` data msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.tablestyleinfo.aspx

Attributes

name[RW]

@return [String] A string representing the name of the table style to use with this table. If the style name does not correspond to the name of a table style then the spreadsheet application should use default style. The possible values for this attribute are defined by the ST_Xstring simple type (22.9.2.19).

show_column_stripes[RW]

@return [True, False] A Boolean indicating whether column stripe formatting is applied.

show_first_column[RW]

@return [True, False] A Boolean indicating whether the first column in the table should have the style applied.

show_last_column[RW]

@return [True, False] A Boolean indicating whether the last column in the table should have the style applied.

show_row_stripes[RW]

@return [True, False] A Boolean indicating whether row stripe formatting is applied.

Public Instance Methods

parse(node) click to toggle source

Parse TableStyleInfo data @param [Nokogiri::XML:Element] node with TableStyleInfo data @return [TableStyleInfo] value of TableStyleInfo data

# File lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/table_style_info.rb, line 25
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'name'
      @name = value.value.to_s
    when 'showColumnStripes'
      @show_column_stripes = attribute_enabled?(value)
    when 'showFirstColumn'
      @show_first_column = attribute_enabled?(value)
    when 'showLastColumn'
      @show_last_column = attribute_enabled?(value)
    when 'showRowStripes'
      @show_row_stripes = attribute_enabled?(value)
    end
  end
  self
end