[Solved] How to list DB data like this in MVC4?
Without changing your data structure, you could simply do the following (assuming your Model doesn’t have a lot of items in it): EDIT: As requested in comments, I’ve added it so each header row only contains 5 items: <table> <tr> @for (int i = 0; i < Model.Count(); i++) { <th>@item.Id</th> @if ((i + 1) … Read more