list.html
페이지 정보

본문
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{include/layout.html}">
<body>
<div layout:fragment="content">
<br>
<center>
<h1>게시판</h1>
<table width=700 border=0>
<tr>
<td>Total : <span th:text="${pm.totalCount}"></span></td>
<td align=right>
<form method="get">
<select name="searchType">
<option value="n" th:selected="${pm.cri.searchType} == 'n'">---</option>
<option value="t" th:selected="${pm.cri.searchType} == 't'">Title</option>
<option value="c" th:selected="${pm.cri.searchType} == 'c'">Content</option>
<option value="w" th:selected="${pm.cri.searchType} == 'w'">Writer</option>
</select>
<input type="text" name='keyword' id="keywordInput" th:value="${pm.cri.keyword}">
<input type="submit" value="Search">
</form>
</td>
</tr>
</table>
<!-- 부모 태그에 전역변수 처리 -->
<table width=700 border=1 th:with="nums=${pm.totalCount - (pm.cri.page - 1) * pm.cri.perPageNum}">
<tr height=30>
<td width="5%" align=center>No</td>
<td width="*">제목</td>
<td width="8%">조회수</td>
<td width="20%">작성일</td>
</tr>
<tr th:if="${#lists.size(list)} > 0" th:each="v, num :${list}"><!-- tr 태그가 반복 -->
<td th:text="${nums - num.index}" align=center></td>
<td th:with="imgstr=${#strings.replace(v.file01,'C:/springboot/web/src/main/resources/static','')}">
<span th:if="${imgstr}"><img th:src="${imgstr}" width=50></span>
<span th:unless="${imgstr}"><img src="/img/no.jpg" width=50></span>
<a th:href="${'view' + pm.makeQuery(pm.cri.page) + '&boardIdx=' + v.boardIdx}" th:text="${v.title}"></a>
</td>
<td th:text="${v.hitCnt}"></td>
<td th:text="${#temporals.format(v.createdDatetime,'yyyy-MM-dd HH:mm:ss')}"></td> <!-- ② -->
</tr>
<tr th:if="${#lists.size(list)} == 0 ">
<td colspan=4 align=center height=50>게시글이 없습니다.</td>
</tr>
</table>
<!-- 페이징 시작 -->
<table width=700 border=0>
<tr>
<td align=center>
<!-- 이전 링크 -->
<span th:if="${pm.prev}">
<a href="list"th:attrappend="href=${pm.makeQuery(pm.startPage - 1)}">«</a>
</span>
<!-- 페이지 -->
<span th:with="start=${pm.startPage} , last=${pm.endPage}">
<span th:each="page: ${#numbers.sequence(start,last)}">
<a th:text="${page}" href="list"th:attrappend="href=${pm.makeQuery(page)}"></a>
</span>
</span>
<!-- 다음 링크 -->
<span th:if="${pm.next && pm.endPage > 0}">
<a href="list"th:attrappend="href=${pm.makeQuery(pm.endPage + 1)}">»</a>
</span>
</td>
</td>
</table>
<!-- 페이징 끝 -->
<table width=700 border=0>
<tr>
<td></td>
<td align=right><a href="write">[글쓰기]</a></td>
</tr>
</table>
</center>
<br>
</div>
</body>
</html>
- 이전글sql-board.xml ( 해당 부분 수정 ) 24.06.12
- 다음글▲ no.jpg 추가 24.06.12
댓글목록
등록된 댓글이 없습니다.