2

This is the file. It is supposed to be a worksheet.

There are lots of tables in the file. Each table has 20 blank rows (for 20 students). I need 40 blank rows (for 40 students).

Adding the rows manually is a menially repetitive task. I found a relatively easy method. Select the 20 rows using the mouse, and then right click. Then an option comes up asking if I want to add 20 rows below or not, but it is still a cumbersome process to repeat for all the tables. How do I accomplish this task more easily?

Edit:

I don't know the Apps Script language, but still I stupidly tried the following code:

function myFunction() {      

for (let table in DocumentApp.getTables()) {      

for (let i = 0; i < 20; i++) {              
table.insertTableRow(20); 

}   

}

It did not work.

11
  • Does this answer your question? Adding multiple rows by script May 19, 2023 at 12:47
  • @graham that's for Sheets, not for a Docs table. May 19, 2023 at 13:28
  • You can probably do it easily with a Google Apps Script. Is that an option for you? May 19, 2023 at 13:28
  • Welcome to Web Applications. This doesn't look like a practical, detailed question. Please check out tour and How to Ask. P.S. You can use add-ons and Google Apps Script to extend Google Docs features. The Google Docs Editors Help Center has an article about this, and the Google Docs app and the Google Docs editor have a Help menu that could make it easy to find. If you need further help, please edit the question to make it a good fit for this site. May 19, 2023 at 13:50
  • @YisroelTech Yes, that is indeed an option for me. Do you have the code? May 19, 2023 at 15:07

0

Browse other questions tagged or ask your own question.