• Thymeleaf分页


    网上找到的例子回来测试一下

    <div class="table-pagination">
        <ul class="pagination">
            <li th:class="${contactsPage.number eq 0} ? 'disabled' : ''">
                <a th:if="${not contactsPage.firstPage}" th:href="@{${'/contacts'}(page=${contactsPage.number-1},size=${contactsPage.size})}">Previous</a>
                <a th:if="${contactsPage.firstPage}" href="javascript:void(0);">Previous</a>
            </li>
    
            <li th:each="pageNo : ${#numbers.sequence(0, contactsPage.totalPages - 1)}" th:class="${contactsPage.number eq pageNo}? 'active' : ''">
                <a th:if="${contactsPage.number  eq pageNo}" href="javascript:void(0);">
                    <span th:text="${pageNo + 1}"></span>
                </a>
                <a th:if="${not (contactsPage.number  eq pageNo)}" th:href="@{${'/contacts'}(page=${pageNo},size=${contactsPage.size})}">
                    <span th:text="${pageNo + 1}"></span>
                </a>
    
            </li>
            <li th:class="${contactsPage.number + 1 ge contactsPage.totalPages} ? 'disabled' : ''">
                <a th:if="${not contactsPage.lastPage}" th:href="@{${'/contacts'}(page=${contactsPage.number+1},size=${contactsPage.size})}">Next</a>
                <a th:if="${contactsPage.lastPage}" href="javascript:void(0);">Next</a>
            </li>
        </ul>
    </div>
  • 相关阅读:
    2019年第九周作业
    2019年春第八周作业
    2019年春第七周作业
    2019春第六周作业
    2019年春季学期第五周作业
    2019年春季学期第四周作业
    2019年春季学期第三周作业 ----PTA作业
    2019年春季学期第三周作业
    2019春第七周作业
    第五周作业
  • 原文地址:https://www.cnblogs.com/hyl8218/p/5882071.html
Copyright © 2020-2023  润新知