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

183
Views
Cómo aplicar el mismo color de fila cuando la fila se expande para una tabla

hola tengo un problema ayudenme a solucionarlo

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

0

Dado que el color de fondo NO dependerá de la información del índice par/impar, simplemente debe utilizar otro enfoque para el estilo.

Lo que haría personalmente es usar clases CSS para identificar las filas pares/impares iniciales y cuando una fila se extienda, dé a sus hijos la misma clase.

No compartiste el código 'expandir', así que realmente no sé cómo podrías hacer eso, pero algo así:

 <tr key={i} className={`Itable-row-default table-row-${i} ${i%2 === 0 ? 'table-white' : 'table-grey'}` } > <td colspan={columnData.length + 1}> {dataExpand[i]} </td> </tr>

Y el css asociado

 tr { &.table-gray { background: gray; } &.table-white { background: white; }

}

Dependiendo del método 'onExpandHandler' y el formato de su modelo inicial, esto podría necesitar algunas adaptaciones :)

(Ah, y deberías favorecer las capturas de pantalla para las imágenes: p)

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!