If you have a string variable with \n
in it, that you want to put inside td
, you can try
<td>
{value
.split('\n')
.map((s, index) => (
<React.Fragment key={index}>
{s}
<br />
</React.Fragment>
))}
</td>