最近在做毕业设计,需要在前台把后台的数据用表格显示出来,发现一款表格组件神器–Bootstrap Table, 这次记录下来,方便以后使用。
1.第一种
只是用到table标签
注意:data-url的路径和data-method是controller层的@PostMapping
<table id="mytable" data-toggle="table"
data-url="/test" data-method="post"
data-query-params="queryParams" data-toolbar="#toolbar"
data-search="true" data-show-refresh="true"
data-show-toggle="true" data-show-columns="true"
data-page-list="[2,4,8,16,ALL]" data-pagination="true">
<thead>
<tr>
<th width="70" data-field="id">id</th>
<th width="70" data-field="studentId">studentId</th>
<th width="94" data-field="password">password</th>
</thead>
</table>
2.第二种
2.1