title: ASP.NET MVC Razor engine show three data in each row?
body: <p>In the <a href="http://en.wikipedia.org/wiki/Microsoft_ASP.NET_Razor_view_engine" rel="nofollow">ASP.NET MVC Razor</a> engine I want to show three data entries in each row so I write this:</p>
  
  <pre><code>&lt;table width="100%" border="0" cellspacing="22" cellpadding="0" style="line-height:18px;"&gt;
      &lt;tr&gt;
          &lt;td align="center" valign="top"&gt;
              &lt;table border="0" cellspacing="0" cellpadding="0"&gt;
                  &lt;tr&gt;
                      @{
                          int counter = 0;
                          foreach (MVCTaranehMah.Models.Folder item in ViewBag.items)
                          {
                              counter++;
                              if(counter%3 == 0)
                              {
                                  &lt;tr&gt;
                              }
                              &lt;td width="205" height="180" align="center" valign="top"&gt;&lt;a href="galleryDetails?id=@item.id" &gt;&lt;img src="@Url.Content(item.thumb)" width="173" height="173" border="0"&gt;&lt;/a&gt;&lt;br /&gt;
                                  &lt;p align="center" valign="top" class="header3"&gt;@item.title&lt;/p&gt;
                              &lt;/td&gt;
                              @if(counter%3 == 0)
                              {
                                  &lt;/tr&gt;
                              }
                          }
                      }
                   &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>But I get this error</p>
  
  <blockquote>
    <p>The code block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup.</p>
  </blockquote>
  
  <p>What's the problem and how can I do something like this?</p>