I am trying to create a similar calendar as shown in the image below:
I have the following code:
<table>
@for(var item = Model.StartDate; item <=Model.StartDate.AddDays(7); item = item.AddDays(1))
{
<th>@item.ToString("ddd")</th>
<tr>
<td>@item.ToString("MMM") @item.ToString("dd")</td>
</tr>
}
</table>
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.
<th>need to be nested in<tr>. Also, are you just trying to create the header row?