This is a simple problem that I've been trying to solve for several hours. I have an array containing information of several students and marks they scored in tests. There are 8 subjects in total, with each subject having 5 parameters.
The array looks like below:
Array
(
[Ron] => Array
(
[subject1] => Array
(
[test1] => 47
[test2] => 86
[total] => 133
[percentage] => 88.67
[status] => Pass
)
[pass_count] => 8
[fail_count] => 0
[gross_total] => 963
[gross_percentage] => 80.25
[...]
[subject8] => Array
(
[test1] => 48
[test2] => 86
[total] => 134
[percentage] => 89.33
[status] => Pass
)
[pass_count] => 8
[fail_count] => 0
[gross_total] => 900
[gross_percentage] => 75.50
)
[John] => Array
(
[subject1] => Array
(
[test1] => 39
[test2] => 72
[total] => 111
[percentage] => 74
[status] => Pass
)
[pass_count] => 8
[fail_count] => 0
[gross_total] => 963
[gross_percentage] => 80.25
[...]
[subject8] => Array
(
[test1] => 39
[test2] => 75
[total] => 114
[percentage] => 76
[status] => Pass
)
[pass_count] => 8
[fail_count] => 0
[gross_total] => 846
[gross_percentage] => 70.5
)
)
I need to display the following in a nicely formatted HTML table (I'm planning to use Bootstrap), but I can't for the life of me figure out how to properly nest the table using PHP.
This is the HTML markup that I currently have: http://jsfiddle.net/9y910uvp/
This gives the following result:

Which is okay.
The Actual Problem
I'm using PHP to display the contents from the array. I'm confused how to display the values for the nested <tr> and <td> sections.
How do I loop through the array and display the contents correctly? (I'd post my attempts so far, but they're all stupid and not working so I'm not posting).
An example would be greatly appreciated because I've spent countless hours trying to get this working, but failed terribly.

