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

180
Visualizações
Update entire HTML table column using JS

I want to update entire column with new_data

I tried to update as bellows

 response.json().then(function (new_data){
        console.log(new_data)
       
        var body_data = " ";

        new_data.forEach((item) => {
        var list_data = "";
        list_data += "<td>" + item.vc_state + "</td>";
        body_data += list_data;
        });

        $('#vc_state').html(body_data);  })

But it update only the cell as bellows enter image description here

I want to update entire State column with new data

Please help me to solve this

Updated

I updated as follows

 response.json().then(function (data){
        console.log(data)
        var body_data = " ";
        data.forEach((item) => {
        var list_data = "";
        list_data += "<td>" + item.vc_state + "</td>";
        $('#vc_state').replaceWith(list_data);
      });

It worked. But it changed the HTML only once . I need to update HTML when I call the function without refreshing the page

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

watch table infor with w3c will help you. table>thead|tbody>tr>td|th.

about 4 years ago · Santiago Gelvez 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