asp.net mvc - Foreach loop table, max 2 cells then a new row? -


I have a question about my foreach loop on table design in my evolutionary view.

I want my loop to output up to 2 cells for each table row and if it has data of loop outside more than 2 cells then it adds a new line and that line Continues to loop out the data of the cells of etc.

Does anyone have the solution?

You should not use tables for this.

Instead, give your content & lt; Div & gt; Insert float: left or in display: inline-block in s and create parent element is enough to catch only two children.

Comments