第一种:在html中
<div class="col-xs-12 col-sm-6 col-md-5 col-lg-4">
<div class="panel panel-default panel-intro">
<div class="panel-body">
<div id="myTabContent1" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar1" class="toolbar">
{:build_toolbar('refresh')}
</div>
<table id="table1" class="table table-striped table-bordered table-hover" width="100%"
data-search="false" data-show-toggle="false"
data-show-columns="false" data-show-export="false"
data-common-search="false"
>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
```![在这里插入图片描述](https://img-blog.csdnimg.cn/470ebb23e5864e12a20c723b379f78ad.png)
## 第二种 js文件中
![在这里插入图片描述](https://img-blog.csdnimg.cn/90b7dafd4c9444a29f5609f59d8c78f1.png)
```js
first: function () {
// 表格1
var table1 = $("#table1");
table1.bootstrapTable({
url: 'category/index',
sortName: 'id',
search: false,
commonSearch: false,
visible: false,
showToggle: false,
showColumns: false,
showExport: false,
columns: [
[
// {field: 'state', checkbox: true,},
{field: 'id', title: 'ID',operate:false},
{field: 'name', title: __('Category.name'),operate:false},
{
field: 'operate', title: __('Operate'), table: table1, events: Table.api.events.operate, buttons: [
{
name: 'log',
title: '日志列表',
text: '日志列表',
icon: 'fa fa-list',
classname: 'btn btn-primary btn-xs btn-click',
click: function (e, data) {
// $("#myTabContent2 .form-commonsearch input[name='username']").val(data.username);
$("#myTabContent2 .btn-refresh").trigger("click");
}
}
], formatter: Table.api.formatter.operate
}
]
]
});
// 为表格1绑定事件
Table.api.bindevent(table1);
},