class Docxi::Word::Contents::Table::TableRow
Attributes
cells[RW]
options[RW]
Public Class Methods
new(options={}) { |self| ... }
click to toggle source
# File lib/docxi/word/contents/table.rb, line 71 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/docxi/word/contents/table.rb, line 93 def render(xml) xml['w'].tr do if options[:height].present? xml['w'].trPr do xml['w'].trHeight('w:val' => options[:height], 'w:hRule' => 'atLeast') xml['w'].cantSplit('w:val' => 'false') end end @cells.each do |cell| cell.render(xml) end end end
tc(options={}, &block)
click to toggle source
# File lib/docxi/word/contents/table.rb, line 82 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