1 Star 3 Fork 1

lizhun/bootstrap-table-example-study

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
4.html 2.89 KB
一键复制 编辑 原始数据 按行查看 历史
lizhun 提交于 2020-01-03 15:25 . readme优化
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Hello, Bootstrap Table!</title>
<link rel="stylesheet" type="text/css" href="./node_modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="./node_modules/bootstrap-table/dist/bootstrap-table.min.css">
<link rel="stylesheet" type="text/css" href="./node_modules/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="./css/style.css">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>后台获取数据、前端分页、行样式、行属性、列排序、列排序选中样式</h5>
</div>
<div class="ibox-content">
<div class="toolbar">
</div>
<!-- table内容 -->
<table id="table"></table>
</div>
</div>
</div>
</div>
<div class="footer fixed_full text-center">
<div>
<strong>Copyright</strong> 飘逸 &copy; 2019-2020
</div>
</div>
</div>
<script type="text/javascript" src="./node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="./node_modules/popper.js/dist/umd/popper.js"></script>
<script type="text/javascript" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="./node_modules/bootstrap-table/dist/bootstrap-table.min.js"></script>
<script type="text/javascript" src="./node_modules/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>
<!-- 自定义js内容 -->
<script type="text/javascript" src="./js/bootstrap-table-custom.js"></script>
<script>
$('#table').bootstrapTable({
height: 500,
theadClasses: 'thead-light',
url: './data.json',
rowStyle: function rowStyle(row, index) {
return {
classes: index%2 == 0 ? 'bg-info' : 'bg-primary',
css: {
color: 'red'
}
};
},
rowAttributes: function rowAttributes(row, index) {
return {
title: '价格:' + row.price
};
},
sortClass: 'table-active',
toolbar: '.toolbar',
pagination: true,
search: true,
columns: [{
field: 'id',
title: 'Item ID',
sortable: true
}, {
field: 'name',
title: 'Item Name'
}, {
field: 'price',
title: 'Item Price'
}]
});
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/piaoyi95/bootstrap-table-example-study.git
git@gitee.com:piaoyi95/bootstrap-table-example-study.git
piaoyi95
bootstrap-table-example-study
bootstrap-table-example-study
master

搜索帮助