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

185
Vistas
i want to add json data to html table

again very basic question i know but i dont know why my code isnt working im buliding an electron app from scratch and i learning these skills from internet only so i have only you guys to ask questions :p

document.getElementById("arrBtn").addEventListener("click", async function (event) {

            getData = await window.api.GetRow()

            let bigArr = document.getElementById("arr").innerHTML = getData;            
        });

the above code giving me a stringyfied array of objects in my html on click event but when im trying to convert those object into row in a table nothing happening on click codes are below

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);
        });

i have already created table and table head in html i just want to add rows in my existing table below is my 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
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