Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 자바스크립트
- postgresql
- 리눅스
- 스프링 부트 쇼핑몰 프로젝트 with JPA
- 백준
- python
- Oracle
- backjoon
- programmers
- CS
- baekjoon
- 자바
- 데이터베이스
- 자료구조
- 스프링부트
- CS지식
- Flutter
- Spring Security
- JPA
- springboot
- 네트워크
- 플러터
- Java
- 프로그래머스
- 시큐리티
- spring
- DB
- 데이터
- 스프링
- 파이썬
Archives
- Today
- Total
Jin's Dev Story
[SpringBoot] 페이징 처리 본문
부트스트랩 사용 시 해당 코드 재사용 가능
<!-- 부트 스트랩 사용할 때 재사용 가능 -->
<div th:with="start=${(items.number/maxPage)*maxPage + 1}, end=(${(items.totalPages == 0) ? 1 : (start + (maxPage - 1) < items.totalPages ? start + (maxPage - 1) : items.totalPages)})" >
<ul class="pagination justify-content-center">
<li class="page-item" th:classappend="${items.first}?'disabled'">
<a th:onclick="'javascript:page(' + ${items.number - 1} + ')'" aria-label='Previous' class="page-link">
<span aria-hidden='true'>Previous</span>
</a>
</li>
<li class="page-item" th:each="page: ${#numbers.sequence(start, end)}" th:classappend="${items.number eq page-1}?'active':''">
<a th:onclick="'javascript:page(' + ${page - 1} + ')'" th:inline="text" class="page-link">[[${page}]]</a>
</li>
<li class="page-item" th:classappend="${items.last}?'disabled'">
<a th:onclick="'javascript:page(' + ${items.number + 1} + ')'" aria-label='Next' class="page-link">
<span aria-hidden='true'>Next</span>
</a>
</li>
</ul>
</div>
'Web & Android > SpringBoot' 카테고리의 다른 글
[SpringBoot] 에러 처리 (0) | 2023.10.14 |
---|---|
[SpringBoot] @Annotation (1) | 2023.10.14 |
[SpringBoot] ResponseEntity (0) | 2023.10.14 |
[SpringBoot] Entity (0) | 2023.10.14 |
[SpringBoot] enum Class (열거형) (0) | 2023.10.14 |