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

214
Vistas
Using DataTables, I'm grabbing HTML strings from an API, but the table cell is displaying "<p>Hello</p>" instead of just "Hello" in a p tag. What do?

I have tried encoding the HTML in my API, but then it just displays "<p>Hello" etc in the cell. I've also tried different variations of Html.Raw and HttpUtility.HtmlDecode in the columns section of the DataTables initializer but it's possible I'm using those incorrectly. I am open to stripping HTML with replace functions if necessary (though keeping the paragraph breaks at least would be ideal), but I have used DataTables to manually render anchor tags in the cell so I don't understand how this is different. How do I tell DataTables "this is not a string, it is HTML and you should render it as such?"

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

0

Finally figured it out. Didn't realize some of the data I had was already encoded, so I had to decode the affected fields before creating the JSON with them. Attempting to decode in the datatables initialization did not work. I used HttpUtility.HtmlDecode(fieldName) in the API Controller, created the JSON using the decoded items, then everything worked as expected. Hope this helps someone someday.

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