Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!