<table class="table current-table">
    <thead>
        <tr class="day-labels">
            <% for (var i = 0; i < days_of_week.length; ++ i) {%>
            <td class="text-center"><%=days_of_week[i]%></td>
            <%}%>
        </tr>
    </thead>
    <tbody>
    <% for (i = 0; i < cal_rows.length; ++i) {%>
        <tr>
            <%
            var row = cal_rows[i];
            for (var j = 0; j < row.length; ++j){
                var day = row[j];
                var cell_class = "";
                if (!day['is_current_month'])
                    cell_class = "other_month";
                else if (day['is_today'])
                    cell_class = "current-day";

                if (day['has_events'])
                    cell_class += " upcoming-event"
            %>
            <td class="text-center"><a href="#" class="<%=cell_class%>" data-day-id="<%=day['day_id']%>"><%=day['day_num']%></a></td>
            <%}%>
        </tr>
    <%}%>
    </tbody>
</table>
