728x90
반응형
#타임리프 반복문 th:each 사용법 및 문법
#th:each
<tr th:each="data, index : ${list}" th:if="${list != null} or ${list.size() != 0}" th:attr="onclick=|fnMove('${data.no}', '${data.name}')|" style="cursorpointer;">
<td onclick="event.cancelBubble=true">
<label th:for="'type'+${index.count}" class="inputChk">
<input type="checkbox" th:id="'type'+${index.count}" th:name="typeArr" th:value="${data.no}"><span>선택</span></label>
</td>
<td th:text="${data.no}"></td>
<td>
<input type="text" th:class="inputName" th:id="${data.no}" th:index=${index.index} th:value="${data.name}" th:attr="change=false"/>
</td>
<td th:text="${#dates.format(data.startDate, 'yyyy-mm-dd HH:mm')} + ' ~ ' + ${#dates.format(data.endDate, 'yyyy-mm-dd HH:mm')}"></td>
<td th:text="${data.id} + '(' + ${data.name} + ')'"></td>
<td th:text="${#dates.format(data.date, 'yyyy-MM-dd')}"></td>
</tr>
<tr th:if="${list == null} or ${list.size() == 0}">
<td colspan="9">조회된 데이터가 없습니다.</td>
</tr>
728x90
반응형
댓글