0

In my MVC-application I have a class with some properties. In the .cshtml-file I loop through these properties like this:

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Age)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.EmployeeID)
        </td>

This works fine and I get a list of all the objects I loop through. I would like to limit the nr of items per column in order to avoid having to scroll down. Lets say that I want 5 items/row lined up next to each-other instead of a long list. Could I maybe create 2 equal divs side by side and have my list fill upp the first one and then the other?

enter image description here

user2915962
  • 2,691
  • 8
  • 33
  • 60
  • You should append a number (ITEM1, ITEM2, ... , ITEMn) to make it clear how you'd like them to be layed out – Alex Feb 06 '14 at 13:12
  • 1
    this question may help you http://stackoverflow.com/questions/18748783/how-can-i-loop-through-my-table-to-display-contents-side-by-side-in-mvc-razor-vi – Guillermo Oramas R. Feb 06 '14 at 13:28

0 Answers0