Bootstrap Table的使用

最近在做毕业设计,需要在前台把后台的数据用表格显示出来,发现一款表格组件神器–Bootstrap Table, 这次记录下来,方便以后使用。

1.第一种

只是用到table标签

注意:data-url的路径和data-method是controller层的@PostMapping
id studentId password

2.第二种

2.1 用到table 和 js 没有翻页的


2.2 用到table 和 js 可以翻页的


3.Controller 层代码

@ResponseBody
@RequestMapping(value="/test",produces = "application/json;charset=utf-8")
    public String test(){
        Wrapper wrapper = new EntityWrapper<>();
        wrapper.isNotNull("id");
        List list = studentDao.selectList(wrapper);
        String data = FastJsonUtils.toString(list);
        return data;
    }
以下是Bootstrap Table显示的页面

Bootstrap Table的使用_第1张图片

你可能感兴趣的:(前端,Bootstrap,Table,前端)