3

i got stuck when im try to build a table with data like this

export const arr = [
{no : '1',
name: 'george',
fruit: 'orange'},
{no : '2',
name: 'jason',
fruit: 'orange'},
{no : '3',
name: 'david',
fruit: 'apple'},]

i want to rowspan when the data same with data index -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>
Dicka Reynaldi
  • 329
  • 2
  • 11

1 Answers1

1

Are you using vanilla JavaScript? I made the code in react.js. You can check here

joa
  • 51
  • 6