Let's say I have the following 2-dimensional structure (1) (with different number of columns):
|T11 T12 T13 |
|T21 T22 T23 T24|
|T31 T32 |
and I would like to build the HTML table with this data, but in the following way (2):
|T11 T21 T31|
|T12 T22 T32|
|T13 T23 |
| T24 |
So actually using matrix transposition doing this is straightforward.
BUT if I am extracting the data from more complicated JSON object and parsing this on-the-fly to get to get this (1), I would prefer just to loop over the (1) somehow to get the output (2) without using transposition.
Could you please help me to understand the best method to achieve it?