3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/tableview/output/html.rb', line 3
def process(tv)
@table = ""
@p = 0
tv.subtables.each do |sub|
tag :h2, sub.title unless sub.title.blank?
tag :table, sub.options do
sub.parts.each do |part|
tag (case part.class.to_s
when "Tableview::ViewHandler::Header"
= true
:thead
when "Tableview::ViewHandler::Footer"
:tfoot
when "Tableview::ViewHandler::Body"
:tbody
end), part.options do
part.rows.each do |row|
tag :tr, row.options do
row.cells.each do |cell|
tag( || cell.options[:header] ? :th : :td, cell.options) do
@table += ERB::Util::html_escape(cell.contents.to_s)
end
end
end
end
end
end
end
end
end
|