<table id="tbl" border="1">
<tr>
<c:forEach begin="1" end="${list[0].id}" varStatus="day1">
<td width="">
<c:choose>
<c:when test="${day1.count <= 9}">0${day1.count}</c:when>
<c:otherwise>
<c:choose>
<c:when test="${day1.count <= list[0].name}">${day1.count}</c:when>
<c:otherwise>
<c:choose>
<c:when test="${day1.count-list[0].name <= 9}">0${day1.count-list[0].name}</c:when>
<c:otherwise>
${day1.count-list[0].name}
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
</td>
</c:forEach>
</tr>
<c:forEach var="row" items="${list}">
<tr>
<c:forEach var="td" begin="1" end="${row.id}" varStatus="day2">
<td
bgcolor="${(day2.count >= row.sid && day2.count < row.sid+row.gongqi) ? 'red' : ''}">
</td>
</c:forEach>
</tr>
</c:forEach>
</table>