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

465
Visualizações
How to show array content in output window?

I'm getting some info from a URL working in javascript in Chrome console.

From a previous code I get an array content with html code as below.

const arrTable = [
                    "<html>",
                    "<table>",
                    "<tr>",
                    "<th>Company</th>",
                    "<th>Contact</th>",
                    "<th>Country</th>",
                    "</tr>",
                    "<tr>",
                    "<td>Alfreds Futterkiste</td>",
                    "<td>Maria Anders</td>",
                    "<td>Germany</td>",
                    "</tr>",
                    "<tr>",
                    "<td>Ernst Handel</td>",
                    "<td>Roland Mendel</td>",
                    "<td>Austria</td>",
                    "</tr>",
                    "</table>",
                    "</html>"
        ]

My goal is to paste it the array content (the table) in MS Excel in order MS Excel interprets it as a table directly without any other manipulation.

I've tried rigth click over arrTable and Copy Object then I paste it in notepad but the text contains the double quotes, commas, square brackets, etc. and I need to clean manually that text to have a valid HTML and be able to paste in Excel.

enter image description here

Is there a way in javascript to show the array content within a temporary output box (like a pop up window) in Chrome? In that way I would be able to copy the output box text and paste it in Excel. Thanks for any help

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

0

Simply use:

console.log(arrTable.join(""));

then right click in the browser console and select: Copy string contents

then paste in Excel.

Paste HTML table in excel

about 4 years ago · Juan Pablo Isaza Relatório

0

In case you are specifically looking for a pop-up in Chrome, something like this might help:

alert(arrTable.join(''))

Working snippet:

const arrTable = [
  "<html>",
  "<table>",
  "<tr>",
  "<th>Company</th>",
  "<th>Contact</th>",
  "<th>Country</th>",
  "</tr>",
  "<tr>",
  "<td>Alfreds Futterkiste</td>",
  "<td>Maria Anders</td>",
  "<td>Germany</td>",
  "</tr>",
  "<tr>",
  "<td>Ernst Handel</td>",
  "<td>Roland Mendel</td>",
  "<td>Austria</td>",
  "</tr>",
  "</table>",
  "</html>"
]

alert(arrTable.join(''))

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