class RDoc::Markup::ToRdoc

def accept_table header, body, aligns

def accept_table header, body, aligns
  widths = header.zip(*body).map do |cols|
    cols.map(&:size).max
  end
  aligns = aligns.map do |a|
    case a
    when nil, :center
      :center
    when :left
      :ljust
    when :right
      :rjust
    end
  end
  @res << header.zip(widths, aligns).map do |h, w, a|
    h.__send__(a, w)
  end.join("|").rstrip << "\n"
  @res << widths.map {|w| "-" * w }.join("|") << "\n"
  body.each do |row|
    @res << row.zip(widths, aligns).map do |t, w, a|
      t.__send__(a, w)
    end.join("|").rstrip << "\n"
  end
end