class OoxmlParser::TableProperties
Class for parsing ‘w:tblPr` tags
Attributes
@return [ValuedChild] caption of table
@return [ValuedChild] description of table
@return [Color] fill type
@return [Shade] shade color of table
@return [OoxmlSize] table cell spacing
@return [TableLayout] table layout
@return [TableStyleColumnBandSize] table style column band size
@return [TableStyle] element of table style
@return [String] id of table style
@return [TableStyleRowBandSize] table style row band size
Public Class Methods
Source
# File lib/ooxml_parser/common_parser/common_data/table/table_properties.rb, line 40 def initialize(parent: nil) @jc = :left @table_borders = TableBorders.new super end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/table/table_properties.rb, line 49 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'tableStyleId' @table_style_id = node_child.text when 'tblBorders' @table_borders = TableBorders.new(parent: self).parse(node_child) when 'tblStyle' # TODO: Incorrect but to keep compatibility @table_style_element = TableStyle.new(parent: self).parse(node_child) when 'tblW' @table_width = OoxmlSize.new.parse(node_child) when 'jc' @justification_object = ValuedChild.new(:symbol, parent: self).parse(node_child) @jc = @justification_object.value when 'shd' @shade = Shade.new(parent: self).parse(node_child) when 'solidFill' @fill = PresentationFill.new(parent: self).parse(node) when 'tblLook' @table_look = TableLook.new(parent: self).parse(node_child) when 'tblInd' @table_indent = OoxmlSize.new(parent: self).parse(node_child) when 'tblpPr' @table_positon = TablePosition.new(parent: self).parse(node_child) when 'tblCellMar' @table_cell_margin = TableMargins.new(parent: table_properties).parse(node_child) when 'tblStyleColBandSize' @table_style_column_band_size = TableStyleColumnBandSize.new(parent: self).parse(node_child) when 'tblStyleRowBandSize' @table_style_row_band_size = TableStyleRowBandSize.new(parent: self).parse(node_child) when 'tblLayout' @table_layout = TableLayout.new(parent: self).parse(node_child) when 'tblCellSpacing' @table_cell_spacing = OoxmlSize.new.parse(node_child) when 'tblCaption' @caption = ValuedChild.new(:string, parent: self).parse(node_child) when 'tblDescription' @description = ValuedChild.new(:string, parent: self).parse(node_child) end end @table_look = TableLook.new(parent: self).parse(node) if @table_look.nil? self end
Parse TableProperties
object @param node [Nokogiri::XML:Element] node to parse @return [TableProperties] result of parsing
Source
# File lib/ooxml_parser/common_parser/common_data/table/table_properties.rb, line 95 def style root_object.table_styles.style_by_id(table_style_id) end
@return [TableStyle] style of table
Source
# File lib/ooxml_parser/common_parser/common_data/table/table_properties.rb, line 101 def table_style root_object.document_style_by_id(table_style_element.value) end
For compatibility reasons @return [DocumentStyle] table style of table