# File lib/wikicloth/wiki_buffer/table.rb, line 27
  def to_html
    row_count = 0
    ret = "<table" + (params[0].blank? ? "" : " #{params[0].strip}") + ">"
    ret += "<caption" + (self.table_caption_attributes.blank? ? "" : " #{table_caption_attributes.strip}") + 
        ">#{table_caption.strip}</caption>" unless self.table_caption.blank?
    for row in rows
      row_count += 1
      unless row.empty?
        ret += "<tr" + (params[row_count].nil? || params[row_count].blank? ? "" : " #{params[row_count].strip}") + ">"
        for cell in row
            cell_attributes = cell[:style].blank? ? "" : parse_attributes(cell[:style].strip).collect { |k,v| "#{k}=\"#{v}\"" }.join(" ")
            cell_attributes = cell_attributes.blank? ? "" : " #{cell_attributes}"
            ret += "<#{cell[:type]}#{cell_attributes}>\n#{cell[:value].strip}\n</#{cell[:type]}>"
        end
        ret += "</tr>"
      end
    end
    ret += "</table>"
  end