title: Building HTML Calendar Using ASP.NET MVC Razor
body: <p>I am trying to create a similar calendar as shown in the image below: </p>
  
  <p><a href="http://i.stack.imgur.com/VdDqD.png" rel="nofollow">calendar sample image</a></p>
  
  <p>I have the following code: </p>
  
  <pre><code>&lt;table&gt;
  
  @for(var item = Model.StartDate; item &lt;=Model.StartDate.AddDays(7); item = item.AddDays(1))
  {   
      &lt;th&gt;@item.ToString("ddd")&lt;/th&gt;  
  
      &lt;tr&gt;
      &lt;td&gt;@item.ToString("MMM") @item.ToString("dd")&lt;/td&gt;
      &lt;/tr&gt;
  }
  
  
  
  &lt;/table&gt;
  </code></pre>
  
  <p>Which of course does not render the correct result. What can I do to produce the result shown in the image? I don't care about the in-active dates. </p>