jquery获取表格
获取行: $(“#table tr”)[val+1];
获取改行第一列: $(“#table tr”)[val+1].children[0];
表格内容:$(“#table tr td:nth-child(4)”)[val].innerText
Jquery及时获取输入数据
$(‘#username’).bind(‘input propertychange’, function () {
console.log($(“input[name=username]”).val());
var iusername = $(“input[name=username]”).val();
console.log(iusername);
});
html中用$parent.$index获取到父级的$index
多表头,一行对应多列
[相关链接](http://www.jb51.net/web/138278.html)1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43<table class="table table-bordered table-hover no-footer">
<thead>
<tr role="row" class="heading">
<th colspan="2">基本信息</th>
<th colspan="6">配送速度</th>
<th colspan="6">服务态度</th>
</tr>
<tr role="row" class="heading">
<th>配送员</th>
<th>服务社区</th>
<th>5星</th>
<th>4星</th>
<th>3星</th>
<th>2星</th>
<th>1星</th>
<th>未评论</th>
<th>5星</th>
<th>4星</th>
<th>3星</th>
<th>2星</th>
<th>1星</th>
<th>未评论</th>
</tr>
</thead>
<tbody ng-show="data.length>0">
<tr role="row" ng-repeat="item in data track by $index">
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
<td>{{item.id}}</td>
</tr>
</tbody>
</table>
一列对多行
1 | <table class="table table-hover table-light"> |
套嵌循环,三层一列多行用js 循环拼接实现
1 | $scope.dealdata= function(val){ |
效果如下
固定复杂表头
1 | <table id="tab" cellpadding="1" cellspacing="1" border="1" align="center"> |
1 | 数据结构 |
效果如下