class RubyDocx::Elements::TableCell

Public Instance Methods

inner_html() click to toggle source
# File lib/ruby_docx/elements/table_cell.rb, line 8
def inner_html
  "#{self.elements.map(&:to_html).join}"
end
to_html() click to toggle source
# File lib/ruby_docx/elements/table_cell.rb, line 12
def to_html
  w = 0
  if self.style
    w = self.style.width.to_i
  end

  if w > 0
    "<td style='width: #{(w/100.0).round(2)}%'>#{self.elements.map(&:to_html).join}</td>"
  else
    "<td>#{self.elements.map(&:to_html).join}</td>"
  end
end
to_s() click to toggle source
# File lib/ruby_docx/elements/table_cell.rb, line 4
def to_s
  self.elements.map(&:to_s).join
end