If the Amount collection is ordered correctly (I assume yes), you can simply use:
foreach (var f in m.Foods) { <tr> <td>@f.Type</td> foreach (var a in m.AmountOfVitamins) { <td>a.Amount</td> } </tr> }
If they are in some other random order, you will need a way to sort them according to the column headings A, B, C, D ...
source share