У меня есть 2 цикла из представлений, которые генерируются в моей таблице.
<tr style='height:19px;'>
<th id="703183278R33" style="height: 19px;" class="row-headers-background">
<div class="row-header-wrapper" style="line-height: 19px;">34</div>
</th>
<td class="s46"></td>
<td class="s51" colspan="3">Subject</td>
<td class="s51" colspan="4">Teacher</td>
<td class="s51" colspan="6">Room and Schedule</td>
<td class="s0"></td>
</tr>
{% for sensie in teacher %}
<tr style='height:19px;'>
<th id="703183278R34" style="height: 19px;" class="row-headers-background">
<div class="row-header-wrapper" style="line-height: 19px;">35</div>
</th>
<td class="s46"></td>
<td class="s51" colspan="3">{{sensie.Subjects}}</td>
<td class="s51" colspan="4">{{sensie.Employee_Users}}</td>
{% endfor %}
{% for room in roomsched %}
<td class="s51" colspan="6">{{room.Classroom}}-{{room.Day_Name}}</td>
</tr>
{% endfor %}
\ views
studentenroll = StudentsEnrollmentRecord.objects.filter(Student_Users=id)
studentgrade = StudentsEnrollmentRecord.Education_Levels
FeesType = SchoolFeesMasterList.objects.filter(Education_Levels__in=studentenroll.values_list('Education_Levels'))
#payment = StudentsPaymentSchedule.objects.filter(Students_Enrollment_Records__in=studentenroll)"payment":payment,
teacher = SubjectSectionTeacher.objects.filter(Education_Levels__in=studentenroll.values_list('Education_Levels'))
roomsched = SubjectRoomSchedule.objects.filter(Subject_Section_Teacher__in=teacher)
#teachers = SubjectSectionTeacher.objects.filter(),"teacher":teacher
return render(request, 'Homepage/enrollmentrecords.html',{"studentenroll":studentenroll,"SchoolFeesType":FeesType,"teacher":teacher,"roomsched":roomsched})
как мне сделать так, чтобы оно было правильно отформатировано в таблице? как на примере ниже.
Subject Teacher Room and Schedule
math example-Teacher room1-mwf