class Kramdown::Parser::Html::ElementConverter

def convert_table(el)

def convert_table(el)
  if !is_simple_table?(el)
    process_html_element(el, false)
    return
  end
  remove_text_children(el)
  process_children(el)
  set_basics(el, :table)
  calc_alignment = lambda do |c|
    if c.type == :tr
      el.options[:alignment] = c.children.map do |td|
        if td.attr['style']
          td.attr['style'].slice!(/(?:;\s*)?text-align:\s+(center|left|right)/)
          td.attr.delete('style') if td.attr['style'].strip.empty?
          $1.to_sym
        else
          :default
        end
      end
    else
      c.children.each {|cc| calc_alignment.call(cc)}
    end
  end
  calc_alignment.call(el)
  el.children.delete_if {|c| c.type == :html_element}
  change_th_type = lambda do |c|
    if c.type == :th
      c.type = :td
    else
      c.children.each {|cc| change_th_type.call(cc)}
    end
  end
  change_th_type.call(el)
  if el.children.first.type == :tr
    tbody = Element.new(:tbody)
    tbody.children = el.children
    el.children = [tbody]
  end
end