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

139
Vistas
how to apply contenteditable for td in Pug

Newbie questions!

How can we use contenteditable (html5) for td in pug? does pug support that? I couldn't find an example anywhere. What's the best way to change text value in td to an textbox so users can edit?

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

0

Simple answer is td(contenteditable)

Longer answer:

First things first. For user input better use <input> or <textarea>. You can append it into td on click event for example. After that set an equal value via power of Javascript, but it is another question)

The result of td(contenteditable) would be <td contenteditable="contenteditable"></td>, so if you need disable "mirroring" to get only <td contenteditable></td> You must setup proper doctype on the first place with doctype or doctype html. That results into <!DOCTYPE html> and <td contenteditable></td>.

Check how result HTML changes with doctype and without, using this code at https://pug.vercel.app/

doctype
html
  table
    tr
      td(contenteditable)

Also it can conflict with your framework setup related to https://github.com/pugjs/pug/issues/237 But using contenteditable itself can be tricky with different browsers.

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