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

185
Visualizações
Google Sheets To Docs

I want to copy all tables exactly like in google sheets,

I tried this script but the table is not the same, does anyone know if the table is exactly the same?

function table() {
  var ss = Sheets.Spreadsheets.Values.get("assassa", String("Sheet1!A1:Z")).values;
  var doc = DocumentApp.openById("asas"); // Or find one by name/ID
  var body = doc.getBody();
 
  var date = new Date();
  var time = date.toLocaleString("id", {
    "day": "2-digit",
    "month": "long",
    "year": "numeric",
    "minute": "2-digit",
    "timeZoneName": "short",
    "minute": "2-digit",
    "second": "2-digit",
    "hour": "2-digit",
  })
  var dataYouWant = ss;// stores a 2D array with the values
  body.clear();
  body.insertParagraph(0, `Data update: ${time}`).setHeading(DocumentApp.ParagraphHeading.HEADING1);
  table = body.appendTable(dataYouWant); // pastes table in doc

  table.getRow(0).editAsText().setBold(true);
}

edit:

enter image description here

From the photo above, the google sheet row F1:G1 data is fused, while in google docs it is not

Link: Google Sheet: https://docs.google.com/spreadsheets/d/1aof6Nt9kadhkIGlNHGmU9sH-j8Q6fOQzgcedD3tjlkk/edit?usp=sharing

Google Docs: https://docs.google.com/document/d/18i8rsuwMkmIPnLUTmRsEBGhye7MQG2Ypn25OcCElZ1Q/edit?usp=sharing

about 4 years ago · Juan Pablo Isaza
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