```
@{ int count = 0;}
@if (Model != null)
{
    <table style="width:100%" border="1">                        
    @foreach (var item in Model)
    {
       @if (count == 0)
       {
           <tr>
       }
       <td style="width:25%">
           <table>
               <tr><td>@Html.DisplayFor(model => item.Item_Title)</td></tr>
               <tr><td>@Html.DisplayFor(model => item.Item_Content)</td></tr>
               <tr><td>@Html.DisplayFor(model => item.Item_Author)</td></tr>
           </table>
       </td>

       @if (count == 3)
       {
           </tr>
       }

       @if (count == 3)
       { count = 0; }
       else (count != 3)
       { count++; }
    }
    </table>
}

```

As the title says,

I tried to use FOREACH to dynamically generate tables in HTML.

But a problem has occurred.

My logic is to dynamically generate a 4\*N Table.

But the code on the red box is recognized as text by the program.

Causes the program in the red box to not work.

How can I fix it?

---

Added @ after the occurrence

He detected that there is no end

Causes the following to become text

Finally jump out does not exist }