Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

141
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda