class Docxer::Word::Contents::Table::TableRow

Attributes

cells[RW]
options[RW]

Public Class Methods

new(options={}) { |self| ... } click to toggle source
# File lib/docxer/word/contents/table.rb, line 60
def initialize(options={})
  @options = options
  @cells = []

  if block_given?
    yield self
  else

  end
end

Public Instance Methods

render(xml) click to toggle source
# File lib/docxer/word/contents/table.rb, line 82
def render(xml)
  xml['w'].tr do
    @cells.each do |cell|
      cell.render(xml)
    end
  end
end
tc(options={}, &block) click to toggle source
# File lib/docxer/word/contents/table.rb, line 71
def tc(options={}, &block)
  if @options[:columns_width]
    width = @options[:columns_width][@cells.size]
    options[:width] ||= width if width
  end
  options = @options.merge(options)
  cell = TableCell.new(options, &block)
  @cells << cell
  cell
end