class Axlsx::TableStyles

TableStyles represents a collection of style definitions for table styles and pivot table styles. @note Support for custom table styles does not exist in this version. Many of the classes required are defined in preparation for future release. Please do not attempt to add custom table styles.

Attributes

defaultPivotStyle[R]

The default pivot table style. The default value is ‘PivotStyleLight6’ @return [String]

defaultTableStyle[R]

The default table style. The default value is ‘TableStyleMedium9’ @return [String]

Public Class Methods

new(options={}) click to toggle source

Creates a new TableStyles object that is a container for TableStyle objects @option options [String] defaultTableStyle @option options [String] defaultPivotStyle

Calls superclass method
# File lib/axlsx/stylesheet/table_styles.rb, line 12
def initialize(options={})
  @defaultTableStyle = options[:defaultTableStyle] || "TableStyleMedium9"
  @defaultPivotStyle = options[:defaultPivotStyle] || "PivotStyleLight16"
  super TableStyle
end

Public Instance Methods

defaultPivotStyle=(v) click to toggle source

@see defaultPivotStyle

# File lib/axlsx/stylesheet/table_styles.rb, line 31
def defaultPivotStyle=(v) Axlsx::validate_string(v); @defaultPivotStyle = v; end
defaultTableStyle=(v) click to toggle source

@see defaultTableStyle

# File lib/axlsx/stylesheet/table_styles.rb, line 29
def defaultTableStyle=(v) Axlsx::validate_string(v); @defaultTableStyle = v; end
to_xml_string(str = '') click to toggle source

Serializes the object @param [String] str @return [String]

# File lib/axlsx/stylesheet/table_styles.rb, line 36
def to_xml_string(str = '')
  str << '<tableStyles '
  serialized_attributes str, {:count => self.size }
  str << '>'
  each { |table_style| table_style.to_xml_string(str) }
  str << '</tableStyles>'
end