spring boot+thymeleaf+semantic ui 分页

参考:

https://my.oschina.net/ayyao/blog/898041

后端 springboot 使用:

com.github.pagehelper.PageInfo,作为分页对象



    com.github.pagehelper
    pagehelper-spring-boot-starter
    1.2.12


controller里代码:

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

String orderBy = "id desc";
PageHelper.startPage(pageNum, 10, orderBy);
List users = userService.list();
if (users != null) {
    PageInfo pageInfo = new PageInfo<>(types);
    model.addAttribute("pageInfo", pageInfo);
}

前端分页代码:



  
    

      
      
      

    
  

首页、中间页、尾页样式:

其他:

Thymeleaf循环语句_thymeleaf 循环_苦海无边,不能上岸的博客-CSDN博客

Table | Semantic UI 官网

你可能感兴趣的:(spring,boot,java,thymeleaf,semantic,ui)