angularjs 合并单元格
2024-08-31 17:10:20
Html:
<table class="table table-striped">
<thead>
<tr>
<th>国家</th>
<th>价格(EUR)</th>
<th>价格(CNY)</th>
<th>备注</th>
</tr>
</thead>
<tbody ng-repeat="x in tableData">
<tr ng-repeat="y in x.list">
<td ng-if="$index === 0" rowspan={{x.list.length}}>{{x.cnName}}</td>
<td>{{y.eurPrice}}</td>
<td>{{y.cnPrice}}</td>
<td>{{y.remark}}</td>
</tbody>
</table>
controller.js
$scope.tableData = [
{cnName:'aaa',list:[
{cnPrice: '0.22',euroPrice:'0.141',remark:''},
{cnPrice: '0.14',euroPrice:'0.141',remark:'aa'},
{cnPrice: '0.35',euroPrice:'0.171',remark:'c'},
{cnPrice: '0.67',euroPrice:'0.51',remark:'v'}
]},
{cnName:'bbb',list:[
{cnPrice: '0.22',euroPrice:'0.141',remark:''},
{cnPrice: '0.45',euroPrice:'0.171',remark:'c'},
{cnPrice: '0.67',euroPrice:'0.51',remark:'v'}
]},
{cnName:'ccc',list:[
{cnPrice: '0.22',euroPrice:'0.141',remark:''},
{cnPrice: '0.13',euroPrice:'0.141',remark:'aa'},
{cnPrice: '0.35',euroPrice:'0.171',remark:''},
{cnPrice: '0.35',euroPrice:'0.171',remark:''},
{cnPrice: '0.67',euroPrice:'0.51',remark:''}
]}
];
效果:
最新文章
- tomcat重启脚本
- 一排div自由下落
- python 闭包(closure)
- 【失败】制作CentOS镜像
- 如何修改被编译后DLL文件
- Html表格&;lt;table&;gt;还是须要加入一些标签进行优化,能够加入标题&;lt;caption&;gt;和摘要&;lt;table summary&;gt;
- 基于visual Studio2013解决C语言竞赛题之1031猜数
- IT忍者神龟之Photoshop解析新手抠图的5个高速选择工具
- 使用requests模块爬虫
- Java基础笔记14
- 网络通信 -->; Socket、TCP/IP、HTTP、FTP及网络编程
- [Swift]LeetCode675. 为高尔夫比赛砍树 | Cut Off Trees for Golf Event
- 初探Java设计模式2:结构型模式(代理模式,适配器模式等)
- Python 在已创建的数据表添加字段报错问题
- Python3学习策略
- django template if return false
- 2. instr用法
- 查看iOS沙盒(SanBox)文件
- 阅读xtrabackup代码的一点笔记
- 1、Spring Cloud - 微服务简介