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

390
Visualizações
How to map specific HTML table columns and get its data into an array (JS)?

I'm trying to get the table data from some columns and I've tried a couple of variations I could think of, but none worked:

function updateAllTasks() {
var table = document.getElementById("dtable");

var [, ...tr] = table.querySelectorAll("tr");
var tableData = [...tr].map(r => {
var td = r.querySelectorAll("td");
    console.log([...td].map(c => c[0].innerHTML, c[1].innerHTML, c[8].querySelectorAll('input[name="rowcheckbox"]')[0].value)); //This is the one giving me error ReferenceError: c is not defined
})
console.log(JSON.stringify(tableData));
}

Thanks for your help!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

As mentioned by Andy, following data structures logic. The best approach for this case will be to call the data inside of an Array, and after that, build the table with the data.

This will provide more flexibility the moment you process the information.

Reference

  • Javascript Array
  • Arrays in Apps Script
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