Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

125
Vistas
React & HTML: Highlight a table cell with booleans

I'm using React, and was wondering wether it is possible to highlight a table cell with a boolean, kind of this here:

 <table>
  <tr>
    <td {if (highlight)  bgColor = 'red'} >Emil</td>
    <td>Tobias</td>
    <td>Linus</td>
  </tr>
</table> 

(Where highlight is a boolean state variable).

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Yes, you can. Simply use a ternary operator for that:

<td style={{backgroundColor: highlight ? 'red' : ''}} >Emil</td>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda