Style an existing table
set_table_styleStyle existing tables by adjusting cell padding, background color, borders, column widths, and pinned header rows. Fixes text clipping, creates borderless tables, and repeats header rows across pages.
Instructions
Edit style/layout of an existing table (located by any cell’s text): cell padding (pt), background color (hex), cell borders, column widths (pt), and pinned header rows. scope selects which cells padding/background/border hit — table (default), row, column, or cell (the row/column of the matched cell). Fixes e.g. thin left padding that clips the first letter of cells; border {width:0} makes a table borderless; headerRows repeats the top rows on every page. A direct edit, not a tracked suggestion.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Target a specific tab by tabId or title (from list_tabs). Defaults to the first tab. | |
| cell | Yes | text of any cell in the target table (locates the table) | |
| page | No | which header/footer, when a doc defines more than one (default-page, first-page, even-page). Omit to use whichever exists. | |
| scope | No | default table | |
| border | No | cell borders, over the same scope as padding/background | |
| account | No | Google account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account. | |
| padding | No | cell padding in points | |
| segment | No | which content tree to target: body (default), or the page header/footer. Header/footer content is invisible to a body read — a letterhead logo lives there. | |
| documentId | Yes | ||
| headerRows | No | repeat the top N rows on every page (Docs’ "pin header rows"); 0 unpins. Independent of scope. | |
| columnWidths | No | set specific column widths (points) by column index | |
| backgroundColor | No | hex, e.g. #f1f3f4 |