class Axlsx::TableStyleInfo

The table style info class manages style attributes for defined tables in a worksheet

Attributes

name[RW]

The name of the table style.

Public Class Methods

new(options = {}) click to toggle source

creates a new TableStyleInfo instance @param [Hash] options @option [Boolean] show_first_column indicates if the first column should

be shown

@option [Boolean] show_last_column indicates if the last column should

be shown

@option [Boolean] show_column_stripes indicates if column stripes should

be shown

@option [Boolean] show_row_stripes indicates if row stripes should be shown @option [String] name The name of the style to apply to your table.

Only predefined styles are currently supported.
@see Annex G. (normative) Predefined SpreadsheetML Style Definitions in part 1 of the specification.
# File lib/axlsx/workbook/worksheet/table_style_info.rb, line 21
def initialize(options = {})
  initialize_defaults
  @name = 'TableStyleMedium9'
  parse_options options
end

Public Instance Methods

initialize_defaults() click to toggle source

Initialize all the values to false as Excel requires them to explicitly be disabled or all will show.

# File lib/axlsx/workbook/worksheet/table_style_info.rb, line 34
def initialize_defaults
  %w(show_first_column show_last_column show_row_stripes show_column_stripes).each do |attr|
    self.send("#{attr}=", 0)
  end
end
to_xml_string(str = '') click to toggle source

seralizes this object to an xml string @param [String] str the string to contact this objects serialization to.

# File lib/axlsx/workbook/worksheet/table_style_info.rb, line 45
def to_xml_string(str = '')
  serialized_tag('tableStyleInfo', str)
end