zoukankan      html  css  js  c++  java
  • BootStrap的table技术小结:数据填充、分页、列宽可拖动

    本文结构:先说明,后代码。拷贝可直接运行。

    一、demo结构:

    二、文件引入

      这些里面除了下面2个比较难找,其他的都很好找

      bootstrap-table-resizable.js

      colResizable-1.6.min.js

      注意:需要将bootstrap-table.js中参数改为resizable: true

    三、模拟的message.json数据准备

    [
    	{
    		"name":"zhangsan1",
    		"password":"1"
    	},
    	{
    		"name":"zhangsan2",
    		"password":"2"
    	},
    	{
    		"name":"zhangsan3",
    		"password":"3"
    	},
    	{
    		"name":"zhangsan4",
    		"password":"4"
    	},
    	{
    		"name":"zhangsan5",
    		"password":"5"
    	},
    	{
    		"name":"zhangsan1",
    		"password":"1"
    	},
    	{
    		"name":"zhangsan2",
    		"password":"2"
    	},
    	{
    		"name":"zhangsan3",
    		"password":"3"
    	},
    	{
    		"name":"zhangsan4",
    		"password":"4"
    	},
    	{
    		"name":"zhangsan5",
    		"password":"5"
    	},
    	{
    		"name":"zhangsan1",
    		"password":"1"
    	},
    	{
    		"name":"zhangsan2",
    		"password":"2"
    	},
    	{
    		"name":"zhangsan3",
    		"password":"3"
    	},
    	{
    		"name":"zhangsan4",
    		"password":"4"
    	},
    	{
    		"name":"zhangsan5",
    		"password":"5"
    	}
    ]
    

     四、table.html

    <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title>BootStrap Table使用</title>
    		<meta name="viewport" content="width=device-width" />
    		<SCRIPT SRC="JS/JQUERY-3.3.1.MIN.JS" TYPE="TEXT/JAVASCRIPT"></SCRIPT>
    		<script src="js/bootstrap-table.js"></script>
    		<script src="js/bootstrap.min.js"></script>
    		<script src="js/bootstrap-table-resizable.js"></script>
    		<script src="js/colResizable-1.6.min.js"></script>
    		<link href="js/bootstrap.min.css" rel="stylesheet" />
    		<link href="js/bootstrap-table.css" rel="stylesheet" />
    	</head>
    	<body>
    		<div class="container">
    			<table id="table" class="table-bordered"></table>
    		</div>
    		<script type="text/javascript">
    			 $('#table').bootstrapTable({
    			 	pagination:true,
    			 	search:true,
    			 	url:'/bootstrap_Table_resizable/json/message.json',
    			 	columns:[{
    			 		field:'name',
    			 		title:'姓名'
    			 	},{
    			 		field:'password',
    			 		title:'密码'
    			 	}]
    			 })
    		</script>
    	</body>
    </html>
    

     五、效果展示

    Best Regards
  • 相关阅读:
    MATLAB getframe
    matlab 中 hold on 和hold off的使用
    在MATLAB中得到系统当前日期、时间的函数
    Matlab 中常用的直线与点形表示属性
    matlab中的unique函数详解
    栈的整体作用
    文件句柄、文件描述符与进程和多线程的那些事
    IP头、TCP头、UDP头详解以及定义
    计算机是如何启动的?
    uCOS-II 任务调度机制
  • 原文地址:https://www.cnblogs.com/pecool/p/9816482.html
Copyright © 2011-2022 走看看