I am trying to create a table that gets its values from a JSON service. I want to create an empty row (or an empty <tr></tr>) after the 6th and 11th rows, but I cannot do it. How can I do it?
{altmanzscoring.titles.map((val, i) => (
<tr>
{val.title == "Altman Z' Puan-İmalatçı Firmalar" ? (
<td style={{ color: '#007FB2', fontWeight: 'bold' }}>{val.title}</td>
) : val.title == "Altman Z' Puan-İmalat Harici Firmalar" && i != 13 ? (
<td style={{ color: '#007FB2', fontWeight: 'bold' }}>{val.title}</td>
) : (
<td>{val.title}</td>
)}
{val.values[0].value == 'Ortalama İflas Riski' ? (
<td style={{ color: '#ebc634' }}>{val.values[0].value}</td>
) : val.values[0].value == 'Düşük İflas Riski' ? (
<td style={{ color: '#47d14c' }}>{val.values[0].value}</td>
) : val.values[0].value == 'Düşük İflas Riski' ? (
<td style={{ color: '#e63c41' }}>{val.values[0].value}</td>
) : (
<td>{val.values[0].value}</td>
)}
{val.values[1].value == 'Ortalama İflas Riski' ? (
<td style={{ color: '#ebc634' }}>{val.values[1].value}</td>
) : val.values[1].value == 'Düşük İflas Riski' ? (
<td style={{ color: '#47d14c' }}>{val.values[1].value}</td>
) : val.values[1].value == 'Düşük İflas Riski' ? (
<td style={{ color: '#e63c41' }}>{val.values[1].value}</td>
) : (
<td>{val.values[1].value}</td>
)}
</tr>
))}
Note: i for index.
I wouldn't add an empty tr, but if you want, just test the index and if the index is a multiple of 5 that case render an additional empty row.
Alternatively you have these options:
tr: nth-child(5n) {margin-cotton: 5px} css selector to add room between the rows.<tbody> tags (one for every group) and add space there