如何使用PHP生成学生标记表

I'm currently working on a little project but had a little problem trying to populate the student marksheet HTML table.

Database design:

student table - student_id, name, class_id, section_id
grade - grade_id, grade_name, grade_point, mark_from, mark_upto,comment
subject - subject_id, name, class_id
mark - student_id, class_id, section_id, subject_id, mark_obtained, mark_total

The problem is how do i generate a mark sheet table having students, scores and subject that are particular to a class. sample format enter image description here

Thanks.