Method: Table#to_html

Defined in:
lib/charlie/etc/minireport.rb

#to_htmlObject



16
17
18
19
20
21
# File 'lib/charlie/etc/minireport.rb', line 16

def to_html
  "<table>\n" +
    "<tr>" + @colnames.map{|t| "<th>#{t}</th>" }.join + "</tr>\n" +
  map{|r| "<tr>\n" + r.map{|e| "\t<td>#{e.gsub('<','&lt;').gsub("\r\n",'<br>')}</td>\n"  }.join + "</tr>\n" }.join +
  "</table>"
end