Google Docs Batch Update icon

Google Docs Batch Update

Build and send Google Docs batch update requests

Create Tables Request → Insert Table

AI-generated

Summary

Creates a new table at a specific location in a Google Doc with a specified number of rows and columns.

Inputs

  • Rows — The number of rows in the table (default: 1).
  • Columns — The number of columns in the table (default: 1).
  • Index (required) — The zero-based index in UTF-16 code units relative to the beginning of the segment specified by segmentId.
  • Segment ID — The ID of the header, footer, or footnote the location is in. An empty ID signifies the document's body.
  • Tab ID — The tab that the location is in. If omitted, the request applies to the first tab.
  • Insertion Location — The type of location for insertion: 'location' (specific index) or 'endOfSegmentLocation' (end of segment).

Output shape

No body — returns the executed request (success/failure).

The operation is part of a batch update. It does not return table data but executes the request to insert the table into the document.

Examples

Example 1: Insert a 3x3 table at the beginning of the document body.

Index: 0, Rows: 3, Columns: 3

Example 2: Insert a table at the end of the document.

Insertion Location: End of Segment Location

Links

Discussion