Is there any other way to print mysql table in html like a matrix from? : i am currently working on a college project.The requirement is to print the data(subject ,class,section) to the corresponding day and hour in html table.I tried my best to achieve the requirement but the html table just prints again and prints the next value where i want all my data to be printed in a single table to corresponding day and hour .

here is the image of my database :
https://imgur.com/a/G4ylbV5

And here is my output which am not satisfied with:
https://imgur.com/a/oa8OLyT

Here is my code:
https://imgur.com/a/2rAT1Ax

i expect the output to be a single table with all the respected data in the corresponding place.

