【发布时间】:2022-01-26 20:36:56
【问题描述】:
当我尝试用这样的数据构建一个表时,我被卡住了
export const arr = [
{no : '1',
name: 'george',
fruit: 'orange'},
{no : '2',
name: 'jason',
fruit: 'orange'},
{no : '3',
name: 'david',
fruit: 'apple'},]
当数据与数据索引-1相同时,我想行跨度
import arr from './constant'
<table>
<tr>
<th>no</th>
<th>name</th>
<th>fruit</th>
</tr>
{arr.map((el)=>(
<tr>
<td>{el.no}</td>
<td>{el.name}</td>
<td rowspan={?????????}>{el.fruit}</td>
</tr>
))}
</table>
【问题讨论】:
标签: javascript html css html-table datatable