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

466
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
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