Bootstrap table的基础用法
一、官方文档
Bootstrap 中文网:http://www.bootcss.com/
Bootstrap Table 中文网 : http://bootstrap-table.wenzhixin.net.cn/zh-cn/
二、Bootstrap Table的引入
(一)下载
1.源码:包含了 css,JavaScript,多语言和扩展,以及文档。
http://bootstrap-table.wenzhixin.net.cn/zh-cn/getting-started/
2.克隆或者 Fork 通过 GitHub。
https://github.com/wenzhixin/bootstrap-table
3.CDN:CDNJS 或者 bootcss 提供了 CDN 来支持 Bootstrap table 的 CSS 和 JavaScript 文件链接。
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/bootstrap-table.min.css">
- <!-- Latest compiled and minified JavaScript -->
- <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/bootstrap-table.min.js"></script>
- <!-- Latest compiled and minified Locales -->
- <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/locale/bootstrap-table-zh-CN.min.js"></script>
4.Bower:通过 Bower 来安装和管理 Bootstrap table 的 CSS,JavaScript, 多语言和扩展。
$ bower install bootstrap-table
(二)引入
引入 Bootstrap 库(假如你的项目还没有使用)和 bootstrap-table.css
到 head 标签下。
- <link rel="stylesheet" href="bootstrap.min.css">
- <link rel="stylesheet" href="bootstrap-table.css">
引入 jQuery 库,bootstrap 库和 bootstrap-table.js
到 head 标签下或者在 body 标签关闭之前(一般建议这么做)。
- <script src="jquery.min.js"></script>
- <script src="bootstrap.min.js"></script>
- <script src="bootstrap-table.js"></script>
- <-- put your locale files after bootstrap-table.js -->
- <script src="bootstrap-table-zh-CN.js"></script>
同时,还要引用相关的css。
需要注意的是bootstrap.css和bootstrap.js的版本需一致且不要低于3.3.5的版本;bootstrap-table及bootstrap 3.3.5依赖jquery的版本不要低于1.9.1。
三、使用
(一)通过data属性的方式
无需编写 JavaScript 启用 bootstrap table,对普通的 table 设置 data-toggle="table"
即可。
- <table data-toggle="table" data-url="data1.json">
- <thead>
- <tr>
- <th data-field="id">Item ID</th>
- <th data-field="name">Item Name</th>
- <th data-field="price">Item Price</th>
- </tr>
- </thead>
- </table>
(二)通过 JavaScript 的方式
- <table id="table"></table>
- $('#table').bootstrapTable({
- url: 'data1.json',
- columns: [{
- field: 'id',
- title: 'Item ID'
- }, {
- field: 'name',
- title: 'Item Name'
- }, {
- field: 'price',
- title: 'Item Price'
- }, ]
- });
Bootstrap table的基础用法的更多相关文章
- JS组件系列——表格组件神器:bootstrap table(二:父子表和行列调序)
前言:上篇 JS组件系列——表格组件神器:bootstrap table 简单介绍了下Bootstrap Table的基础用法,没想到讨论还挺热烈的.有园友在评论中提到了父子表的用法,今天就结合Boo ...
- JS组件系列——表格组件神器:bootstrap table(三:终结篇,最后的干货福利)
前言:前面介绍了两篇关于bootstrap table的基础用法,这章我们继续来看看它比较常用的一些功能,来个终结篇吧,毛爷爷告诉我们做事要有始有终~~bootstrap table这东西要想所有功能 ...
- ABP+AdminLTE+Bootstrap Table权限管理系统第二节--在ABP的基础做数据库脚本处理
返回总目录:ABP+AdminLTE+Bootstrap Table权限管理系统一期 第一点,上一篇文章中我们讲到codefirst中一些问题包括如图,codefirst在每次执行命令的时候会生成新的 ...
- Bootstrap fileinput:文件上传插件的基础用法
官网地址:http://plugins.krajee.com/ 官网提供的样例:http://plugins.krajee.com/file-input/demo 基础用法一 导入核心CSS及JS文件 ...
- Bootstrap Table 的用法
记录下 Bootstrap Table 的用法,备忘. <!DOCTYPE html> <html> <head> <meta charset="u ...
- BootStrap Table超好用的表格组件基础入门
右侧导航条有目录哟,看着更方便 快速入门 表格构建 API简单介绍 主要研究功能介绍 快速入门 最好的资源官方文档 官方文档地址****https://bootstrap-table.com/docs ...
- bootstrap table教程--使用入门基本用法
笔者在查询bootstrap table资料的时候,看了很多文章,发觉很多文章都写了关于如何使用bootstrap table的例子,当然最好的例子还是官网.但是对于某部分技术人员来说,入门还是不够详 ...
- JS组件系列——表格组件神器:bootstrap table
前言:之前一直在忙着各种什么效果,殊不知最基础的Bootstrap Table用法都没有涉及,罪过,罪过.今天补起来吧.上午博主由零开始自己从头到尾使用了一遍Bootstrap Table ,遇到不少 ...
- [转]JS组件系列——表格组件神器:bootstrap table
原文地址:https://www.cnblogs.com/landeanfen/p/4976838.html 前言:之前一直在忙着各种什么效果,殊不知最基础的Bootstrap Table用法都没有涉 ...
随机推荐
- lua 与C通过c api传递table
此文转自http://blog.csdn.net/perfect2011/article/details/19200511(感谢...) 首先了解下c++与lua之间的通信: 假设在一个lua文件中有 ...
- ChartCtrl源码剖析之——CChartLegend类
CChartLegend类用来绘制每一个波形的描述信息,它处于该控件的区域,如下图所示: CChartLegend类的头文件. #if !defined(AFX_CHARTLEGEND_H__CD72 ...
- E20180305-hm-xa
raw adj. 生的,未加工的; 无经验的; 新近完成的; 发炎的,疼痛的; payload n. 有效载荷; (航天器.卫星的) 装备; (车辆等的) 装载货物; (炸弹.导弹的) 爆炸力;
- [POJ2750]Potted Flower
Description The little cat takes over the management of a new park. There is a large circular statue ...
- 递推DP UVA 473 Raucous Rockers
题目传送门 题意:n首个按照给定顺序存在m张光盘里,每首歌有播放时间ti,并且只能完整的存在一张光盘里,问最多能存几首歌 分析:类似01背包和完全背包,每首歌可存可不存,存到下一张光盘的情况是当前存不 ...
- 题解报告:NYOJ 题目143 第几是谁?(逆康托展开)
描述 现在有"abcdefghijkl”12个字符,将其按字典序排列,如果给出任意一种排列,我们能说出这个排列在所有的排列中是第几小的.但是现在我们给出它是第几小,需要你求出它所代表的序列. ...
- synchronized(1)用法简介:修饰方法,修饰语句块
注意: 同一个对象或方法在不同线程中才出现同步问题,不同对象在不同线程互相不干扰. synchronized方法有2种用法:修饰方法,修饰语句块 1.synchronized方法 是某个对象实例内,s ...
- net start iisadmin报错:系统找不到指定的文件
IIS Admin Service不能启动 ,直接启动或命令(net start iisadmin)都不成功.导致IIS站点访问异常. 最终参考网上解决方案: 这是大多是由于windows\syste ...
- easy ui combotree的操作
1.获取combotree的选中值 $("#id").combotree("getValue"); 2.设置combotree的选中值 $('#id').com ...
- AJPFX关于抽象方法和接口
class Demo_Animal1{ public static void main(String[] args) { Cat a = new Cat("加菲 ...