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

167
Views
Parece que no puedo borrar el cuerpo de una tabla correctamente, no eliminarlo, solo borrar las filas y las celdas que contenga.

Así es como se ve mi html

 <table id="emails-list"> <tbody> </tbody> </table>

Luego, usando Javascript, quiero agregar filas y columnas, pero primero quiero borrar cualquier cosa que esté en el cuerpo para no agregar/apilar las mismas filas y columnas cada vez que se llama a la función.

 function DisplayEmails(item){ //searching for table var table = document.querySelector('tbody'); // somehow clear the tbody of the table here ????? // adding a row var row = table.insertRow(0); // adding 3 cells to the row var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); var cell3 = row.insertCell(2); cell1.innerHTML = item.sender; cell2.innerHTML = item.subject; cell3.innerHTML = item.timestamp;
about 4 years ago · Juan Pablo Isaza
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!