<tr><th></th>{% for d in days if (d.index <5)or(d.lectures|length)> 0%}<thcolspan="{{d.maxcol}}">{{ d.date.strftime("%A (%d.%m.%Y)") }}</th>{% endfor %}</tr>
<tr><thstyle="width: 30px;"></th>{% for d in days if (d.index <5)or(d.lectures|length)> 0%}<thstyle="width: {{ 100/(days|length) }}%"colspan="{{d.maxcol}}">{{ d.date.strftime("%A (%d.%m.%Y)") }}</th>{% endfor %}</tr>
{% if ((loop.index - 1) is divisibleby 4) %} <tdrowspan="4"style="vertical-align: top;">{{ t.strftime("%H:%M") }}</td> {% endif %}
{% for d in days if (d.index <5)or(d.lectures|length)> 0 %}
{% for i in range(1,d.maxcol+1) %}
{% for l in d.lectures|selectattr('timetable_col','equalto',i) if (((l.time.time() > t) and (l.time.time() <times[time_loop.index+1]))!=(l.time.time() ==t))%}
<tdrowspan="{{l.duration / 15}}"style="background: {% if l.visible and l.course.visible %}lightgrey;{% else %}#f2dede{% endif %}">
<td{%ifi ==1%}class="newday"{%endif%}rowspan="{{l.duration / 15}}"style="background: {% if l.visible and l.course.visible %}lightgrey;{% else %}#f2dede{% endif %}">