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

182
Views
quiero agregar datos json a la tabla html

de nuevo, una pregunta muy básica, lo sé, pero no sé por qué mi código no funciona. Estoy creando una aplicación de electrones desde cero y aprendo estas habilidades solo de Internet, así que solo tengo a ustedes para hacer preguntas: p

 document.getElementById("arrBtn").addEventListener("click", async function (event) { getData = await window.api.GetRow() let bigArr = document.getElementById("arr").innerHTML = getData; });

el código anterior me da una serie de objetos en cadena en mi html en el evento de clic, pero cuando intento convertir esos objetos en una fila en una tabla, no sucede nada en los códigos de clic que se encuentran debajo

 document.getElementById("arrBtn").addEventListener("click", async function (event) { // const myArr = async () => { getData = await window.api.GetRow() let bigArr = document.getElementById("arr").innerHTML = getData; function buildTable(data){ let table = document.getElementById("myTable"); for (let i = 0; i < data.length; i++) { let line = `<tr> <td>${data[i].name}</td> <td>${data[i].property}</td> </tr>` table.innerHTML += line } } buildTable(getData); });

Ya he creado la tabla y el encabezado de la tabla en html, solo quiero agregar filas en mi tabla existente a continuación es mi html

 <table class="responsive-table striped"> <thead> <tr> <th>Name</th> <th>Property</th> </tr> </thead> <tbody id="myTable"> <tr> <td>Alvin</td> <td>Eclair</td> </tr> </tbody> </table>

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!