i create a table from a multilevel array wich is loaded from a database and processed, the problem is that the data loaded will some times have gaps in the position that it should be inside a certain html column...
i canĀ“t quite explain it so i'll give an example.
[0] => array(
[name] => john
[id] => 2
[data] => array([data1] => array(
[0] => array(
[value] => 10
[order] => 1
)
[1] => array(
[value] => 5
[order] => 3
)
[data3] => array([0] => array(
[value] => 30
[order] => 1
)
)
)
| id | Name | Data1 | Data2 | Data3 |
| 2 | john | 10 | | 5 | | | 2 |
|other varied values...|
inside john>data1 there wasnt a order 2 specified so it should create an empty <td> in the correspondent position
and then adapt the rest of the table so that there is always the same number of <td> under each colomn.
i managed to make that but the code is really really big and messy with a lot of loops, it is currently using too much processing power to achieve that.
so i came here to ask if you guys have any suggestion that could help ease this process