拓展配置地址:https://datatables.net/download/
在官网可以自己diy样式,这个自由发挥
编程学习英文很重要,一定要逼着自己学好英文,官网上例子写的很清楚,写一写自己做的一个demo
1.https://start.spring.io/ springboot简单生成一个demo工程,maven+tomcat+thymeleaf
2.application.properties配置
# 定位模板的目录
spring.mvc.view.prefix=classpath:/templates/
# 给返回的页面添加后缀名
spring.mvc.view.suffix=.html
spring.thymeleaf.cash=false
3.写个简单controller
@Controller
@RequestMapping("/index")
public class IndexController {
@RequestMapping("/a")
public String get(){
return "index";
}
}
4.创建html文件body写一个table
<div class="row">
<div class="col-md-12 col-sm-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue-hoki">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-list"></i>数据列表
</div>
<div class="tools">
</div>
</div>
<div class="portlet-body">
<table