相关文档
Bootstrap Table官网:http://bootstrap-table.wenzhixin.net.cn/zh-cn/
Bootstrap 中文网:http://www.bootcss.com/
Bootstrap Table Demo:http://issues.wenzhixin.net.cn/bootstrap-table/index.html
步骤:
1:引入Bootstrap Table表格插件相关链接:这里直接拿来用就可以了,如果要下载到本地,可以自行去官网下载。
2:实现一个简单的表格和分页
如果不会可以参考这篇教程:
https://www.jianshu.com/p/b5ca011a0d9c
自己写了一个json格式的数据,进行模拟
3:前端js实现打印(导出)excel表格
参考:https://www.jianshu.com/p/b5bcee88cf40
4:可复制黏贴的代码:
data1.json
[
{
"id": 0,
"name": "高渐离",
"price": "$0"
},
{
"id": 1,
"name": "王昭君",
"price": "$1"
},
{
"id": 2,
"name": "安琪拉",
"price": "$2"
},
{
"id": 3,
"name": "蔡文姬",
"price": "$3"
},
{
"id": 4,
"name": "孙尚香",
"price": "$4"
},
{
"id": 5,
"name": "甄姬",
"price": "$5"
},
{
"id": 6,
"name": "妲己",
"price": "$6"
},
{
"id": 7,
"name": "米莱地",
"price": "$7"
},
{
"id": 8,
"name": "大乔",
"price": "$8"
},
{
"id": 9,
"name": "小巧",
"price": "$9"
},
{
"id": 10,
"name": "张亮",
"price": "$10"
},
{
"id": 11,
"name": "诸葛亮",
"price": "$11"
},
{
"id": 12,
"name": "韩信",
"price": "$12"
},
{
"id": 13,
"name": "兰陵王",
"price": "$13"
},
{
"id": 14,
"name": "貂蝉",
"price": "$14"
},
{
"id": 15,
"name": "后裔",
"price": "$15"
},
{
"id": 16,
"name": "黄忠",
"price": "$16"
},
{
"id": 17,
"name": "虞姬",
"price": "$17"
},
{
"id": 18,
"name": "程咬金",
"price": "$18"
},
{
"id": 19,
"name": "庄周",
"price": "$19"
},
{
"id": 20,
"name": "项羽",
"price": "$20"
}
]
导出当前选中页码的表格(这是第一页的数据)
原文作者:祈澈姑娘 技术博客:https://www.jianshu.com/u/05f416aefbe1
90后前端妹子,爱编程,爱运营,文艺与代码齐飞,魅力与智慧共存的程序媛一枚。
坚持总结工作中遇到的技术问题,坚持记录工作中所所思所见,对于博客上面有不会的问题,可以加入qq技术交流群聊:649040560。