Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!