bootstrap-table显示行号
来源:互联网 发布:ubuntu卸载程序命令 编辑:程序博客网 时间:2024/06/12 21:43
bootstrap-table显示行号
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<head>
<meta charset="utf-8">
<title>bootstrap-table显示行号</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/bootstrap-table.css" rel="stylesheet">
</head>
<body>
<div class="container" role="main">
<div class="row">
<div class="col-md-12">
<table class="table table-hover table-bordered" id="gravidaTable">
<thead>
<tr>
<th ></th>
<th >栏目标识</th>
<th>栏目名称</th>
</tr>
</thead>
<tbody>
<tr>
<td ></td>
<td >cs</td>
<td>测试11111</td>
</tr>
<tr>
<td ></td>
<td >cs</td>
<td>测试11111</td>
</tr>
<tr>
<td ></td>
<td >cs</td>
<td>测试11111</td>
</tr>
<tr>
<td ></td>
<td >cs</td>
<td>测试11111</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-table.js"></script>
<script type="text/javascript">
$('#gravidaTable').bootstrapTable({
columns: [{
title: '行号',
align: 'center',
valign: 'bottom',
formatter: function(value, row, index) {
return index + 1;
}
}
]
});
</script>
</body>
</html>
<html lang="zh-CN">
<head>
<head>
<meta charset="utf-8">
<title>bootstrap-table显示行号</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/bootstrap-table.css" rel="stylesheet">
</head>
<body>
<div class="container" role="main">
<div class="row">
<div class="col-md-12">
<table class="table table-hover table-bordered" id="gravidaTable">
<thead>
<tr>
<th ></th>
<th >栏目标识</th>
<th>栏目名称</th>
</tr>
</thead>
<tbody>
<tr>
<td ></td>
<td >cs</td>
<td>测试11111</td>
</tr>
<tr>
<td ></td>
<td >cs</td>
<td>测试11111</td>
</tr>
<tr>
<td ></td>
<td >cs</td>
<td>测试11111</td>
</tr>
<tr>
<td ></td>
<td >cs</td>
<td>测试11111</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-table.js"></script>
<script type="text/javascript">
$('#gravidaTable').bootstrapTable({
columns: [{
title: '行号',
align: 'center',
valign: 'bottom',
formatter: function(value, row, index) {
return index + 1;
}
}
]
});
</script>
</body>
</html>
通过bootstrap-table这个插件可以通过页面和js做到动态显示表格行号的效果,上面js代码里columns是页面加载的时候重新设置了表格的内容属性。默认从第一列开始设置。
官方文档:http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation
通过这个文档可以查阅其他属性的设置
阅读全文
0 0
- bootstrap table 显示行号
- bootstrap-table 显示行号
- bootstrap-table显示行号
- bootstrap-table 显示行号,分页有效
- bootstrap table 单击获取当前行号
- bootstrap table 显示序号
- bootstrap table中显示头行结构
- Bootstrap table-ERP-数据列表显示方法
- bootstrap中table隐藏后显示问题
- BootStrap table增加一列显示序号
- bootstrap-table显示数据时显示No matching records found
- BootStrap -- Table
- Bootstrap Table
- bootstrap--table
- Bootstrap table
- bootstrap-table
- bootstrap table
- Bootstrap Table
- VS Code 也能预览 Markdown
- Island Perimeter (上)
- Python itchat个人微信账号接口定时发送群消息
- 关于Bootstrap的定制
- Linux下date命令格式化时间格式shell脚本获取指定格式日期
- bootstrap-table显示行号
- Linux_开发注意事项
- 机器学习面试1-10题
- 基于Python的分布式高可用扩展引擎Ray 0.2.0发布
- 如何快速转载CSDN中的博客
- codeforces740D
- SpringMVC框架前端控制器、处理适配器和处理器映射器、视图解析器的配置
- Morse Code:摩尔斯电码介绍与科普
- 使用HAL库出现No Cortex-M SW Device Found