I have the following code, I'm trying to get a table with 4 columns across. If I run out of columns, create a new row and make 4 more coumns. rinse. lather. repeat.
<tbody>
<%
int i = 0;
foreach (ItmXtnMultimedia multimedia in ViewData.Model.ItmXtnMultimedia) {
if (i%4 == 0 && i== 0)
{
%><tr><%
}
if (i%4 == 0 && i != 0)
{
%></tr><tr><%
}
%>
<td><%= multimedia.ImgTag100 %></td>
<%
i++;
} %>
It works, but it sucks. Is there something built in to the framework or an extension method I can use? I guess I could roll my own, but figured there had to be something out there.