I have some code which displays some data on a table be adding a new <tr><td>...
It currently display's only 1 item which is name ....
See below:
<tbody>
{
props.names.map( ({name}, i) => <tr key={i}><td>{ name }</td></tr> )
}
</tbody>
If I have more items to display... for example:
id, name, lastname etc
For example:
<td>{ id }</td>
<td>{ name }</td>
<td>{ lastname }</td>
How do I modify the code above so I can do that?
[<>]the snippet editor and create a minimal reproducible exampleprops.namesis an array of objects with properties called id, name etc then yes, it's easily possible by modifying the code you have. (PS since you appear to be using React it might be a good idea to use the "react" tag)