I have a view that contains nothing but the following:
<table>
@for (int i = 0; i < 10; i++)
{
if (i % 5 == 0)
{
<tr>
}
<td>
Hello
</td>
if (i % 5 == 0)
{
</tr>
}
}
</table>
I intended to produce is the following
<table>
<tr>
<td>Hello</td>
<td>Hello</td>
<td>Hello</td>
<td>Hello</td>
<td>Hello</td>
</tr>
<tr>
<td>Hello</td>
<td>Hello</td>
<td>Hello</td>
<td>Hello</td>
<td>Hello</td>
</tr>
</table>
But instead it produced the following:
<table>
<tr>
}
<td>
Hello
</td>
if (i % 5 == 0)
{
</tr>
<tr>
}
<td>
Hello
</td>
if (i % 5 == 0)
{
</tr>
</table>
What is wrong?