I'm trying to validate null values for required columns in an excel sheet and trying to display the result as a table with columns as - row number, null value column names.
Since it is possible for many columns in a row to have null values, I'm storing those columns as an array.
While displaying it in a table, I'm not able to get the comma delimiter in a element.
Any advice to how to display an array with comma delimeters like [a,b,c,--] in a single column abc in a table ?
Presenting a sample code base
export default function App() {
const names = ["a", "b","c"];
return (
<div className="App">
<table>
<thead>
<th>Names</th>
</thead>
<tbody>
<td>{names}</td>
</tbody>
</table>
</div>
);
}
This is giving output as
| Names |
|---|
| abc |
Expecting output as
| Names |
|---|
| a,b,c |
console.log(...)toreturn(...). Don't forget thatmap()must return a value. So, you'll havereturn(<div>{things.map((thing)=>{return (<b>{thing}</b>);}</div>)}. If that works, I'll post it as an answer.