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

223
Vistas
Rendering string from MYSQL in div removes all white space

I am trying to render a string with spaces and line spaces in it.

When I render the string as a value on an input, the spaces show as expected.

<textarea
  rows={15}
  value={content}
/>

When I render the string in a div, all of the white spaces are removed.

<div dangerouslySetInnerHTML={{ __html: content }} />

How can I render a string in the div without removing the white space?

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

0

You could apply white-space: pre-wrap; style to your div, so the white spaces will be displayed

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