【发布时间】:2020-12-18 22:28:50
【问题描述】:
我正在尝试从给定的 json 创建表。这里是 json 结构。我正在使用简单的 html 表来制作与下面快照中提到的表结构相同的表结构。因为数据是动态表结构在我的情况下显示不正确。
{
"e_id": "1234",
"e_o_name": "Contact_info",
"matching_details": [
{
"me_value": "value1",
"matching_attributes": [
{
"me_id": "1234",
"me_name": "28 sai",
"me_list": [
{
"me_type": "Email ID",
"me_email_list": [
{
"me_value": "a@gmail"
},
{
"me_value": "b@gmail"
}
],
"me_percent": "100"
}
]
},
{
"me_id": "5678",
"me_name": "29 meena",
"me_list": [
{
"me_type": "Email ID",
"me_email_list": [
{
"me_value": "c@gmail.com"
},
{
"me_value": ",d@gmail.com"
}
],
"me_percent": "100"
}
]
}
]
},
{
"me_value": "value2",
"matching_attributes": [
{
"me_id": "1234",
"me_name": "rimzim",
"me_list": [
{
"me_type": "Email ID",
"me_email_list": [
{
"me_value": "p@gmail"
},
{
"me_value": "q@gmail"
}
],
"me_percent": "100"
}
]
},
{
"me_id": "5678",
"me_name": "ranu",
"me_list": [
{
"me_type": "Email ID",
"me_email_list": [
{
"me_value": "t@gmail.com"
},
{
"me_value": ",u@gmail.com"
}
],
"me_percent": "100"
}
]
}
]
},
]}
上面的结构是实际的输出。我尝试创建相同的但为了 我的数据是单行的。
enter code here<table>
<tbody>
<tr>
<th>contact</th>
<th>ty</th>
<th>ed</th>
<th>mail</th>
<th>percent</th>
</tr>
<tr>
<td rowspan="4">data.e_o_name</td>
<td rowspan="2" *ngFor="let match of data.matching_details">{{match.me_value}}</td>
<td>28 sai</td>
<th>a@gmail,b@gmail</th>
<td>100</td>
</tr>
</tbody>
非常感谢您的帮助...在此先感谢
【问题讨论】:
标签: javascript json angular angular6 angular2-forms