Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (33 sloc) 827 Bytes
class GenBuilder
attr_accessor :table, :table_header
def initialize
@table = ''
end
def buildcol (text, colspan=1, center=nil)
@table += "\t\t\t\t<td colspan=\"#{colspan}\""
if center
@table += " style=\"text-align:center;\""
end
@table += ">#{text}</td>\r\n"
end
def buildrow (items)
@table += "\t\t\t<tr>\r\n"
skip = 0
(0...items.length).each do |i|
# if skip != 0
# skip -= 1
# else
# x = 1
# x+=1 until !items[i+x].nil? || x > items.length
#puts "#{i}+#{x}: '#{items[i+x]}', #{items[i+x].to_s.length}"
# if items[i+1].nil? && i+1 < items.length
# buildcol(items[i], x+1, true)
# skip = x
# else
buildcol(items[i])
# end
# end
end
@table += "\t\t\t</tr>\r\n"
end
end