Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
How to create an empty row after a specific index?

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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:

  1. You could use the tr: nth-child(5n) {margin-cotton: 5px} css selector to add room between the rows.
  2. you can use multiple <tbody> tags (one for every group) and add space there
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!