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

127
Vistas
How to copy to clipboard using JavaScript where the data will paste separately to each cell in google sheets

I thought by creating an HTML table format will paste to each cell but instead, it only pastes to one cell. for example

let copyTable = e => {
   e.clipboardData.setData('text/html', '<tr><td>Seperate</td><td>each</td><td>word</td></tr >')
   e.preventDefault()
}

Output

A B C
1 Seperateeachword
2

When I use the <br> instead I was able to have each word go to a separate cell

let copyTable = e => {
    e.clipboardData.setData('text/html', 'Seperate<br>each<br>word')
    e.preventDefault()
}

Output

A B C
1 Seperate
2 each
3 word

The only issue I am having now is how to paste data where it goes from A to C and so on instead of going from 1 to 3. I know I could paste special on google sheets and click transposed but I would like to eventually paste tables that can range from A1 to H10.

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