title: "The block is missing }" when I don't close table and tbody tag
body: <p>I'm using ASP.NET MVC Razor (C#) syntax to create a table within a while loop, but unless I do <code>&lt;/tbody&gt;</code> and <code>&lt;/table&gt;</code> within the first statement, I get an error</p>
  
  <blockquote>
    <p>The block is missing }...</p>
  </blockquote>
  
  <p>at the <code>if</code> and <code>for</code> statement. How can I fix this and why does it simply not allow me to let the code run without closing a tag?</p>
  
  <pre><code>@if (Model.Any())
  {
      string currentWaiter = "lex luthor &gt; superman";
      foreach (var item in Model)
      {
          if (currentWaiter.Equals("lex luthor &gt; superman"))
          {
              currentWaiter = item.name;
              &lt;table class="tablesorter"&gt;
                  &lt;thead&gt;
                      &lt;!-- ... some info ... --&gt;
                  &lt;/thead&gt;
              &lt;/table&gt;
              &lt;table class="tablesorter"&gt;
                  &lt;thead&gt;
                      &lt;!-- ... some info ... --&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      &lt;tr&gt;
                          &lt;td class="OpenTables"&gt;
                              @item.method
                          &lt;/td&gt;
                          &lt;td class="OpenTables"&gt;
                              @item.total.ToString("#,##0.00");
                          &lt;/td&gt;
                      &lt;/tr&gt;
          }
          else if (currentWaiter.Equals(item.name))
          {
              //magic and whatnot
          }
          else
          {
              //abracadabra!
              &lt;/tbody&gt;
              &lt;/table&gt;
          }
      }
  }
  </code></pre>
  
  <p>Thanks for reading!</p>