Method: Table#to_html
- Defined in:
- lib/charlie/etc/minireport.rb
#to_html ⇒ Object
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('<','<').gsub("\r\n",'<br>')}</td>\n" }.join + "</tr>\n" }.join + "</table>" end |