def to_html
      time_header, rows = '<th></th>', Array.new
      end_time = Time.new(2013, 1, 1, 21, 0, 0)

      # make the time row
      @time = Time.new(2013, 1, 1, 9, 0, 0)
      while @time < end_time
        time_header += "<th>#{@time.strftime("%-k:%M")}</th>"
        @time += 900
      end

      #make each day row
      (0..4).each do |day|
        classes = @timetable.classes_for_day(day)
        rows << day_row(day, classes)
      end

      rows_str, id_str = '', "id=\"#{@timetable.name}\""
      rows.each{ |r| rows_str += "<tr class=\"day\">\n#{r}\n</tr>\n" }

      %Q{
        <!DOCTYPE html>
        <html>
        <head>
          <title>#{@timetable.name || 'Timetable' } - Timetablr.co</title>
          <style>#{build_css}</style>
        </head>
        <body>
          <h3>#{@timetable.name}</h3>
          <table #{id_str if @timetable.name}>
            <tr id="time">#{time_header}</tr>
            #{rows_str}
          </table>
        </body>
        </html>
      }
    end
def to_html
      time_header, rows = '<th></th>', Array.new
      end_time = Time.new(2013, 1, 1, 21, 0, 0)

      # make the time row
      @time = Time.new(2013, 1, 1, 9, 0, 0)
      while @time < end_time
        time_header += "<th>#{@time.strftime("%-k:%M")}</th>"
        @time += 900
      end

      #make each day row
      (0..4).each do |day|
        classes = @timetable.classes_for_day(day)
        rows << day_row(day, classes)
      end

      rows_str, id_str = '', "id=\"#{@timetable.name}\""
      rows.each{ |r| rows_str += "<tr class=\"day\">\n#{r}\n</tr>\n" }

      %Q{
        <!DOCTYPE html>
        <html>
        <head>
          <title>#{@timetable.name || 'Timetable' } - Timetablr.co</title>
          <style>#{build_css}</style>
        </head>
        <body>
          <h3>#{@timetable.name}</h3>
          <table #{id_str if @timetable.name}>
            <tr id="time">#{time_header}</tr>
            #{rows_str}
          </table>
        </body>
        </html>
      }
    end
HTML5 representation of the timetable