Summary
gog docs exposes no way to apply visual formatting to specific table cells. The underlying Google Docs API does expose this via updateTableCellStyle (for cell-level properties like backgroundColor) and updateTextStyle (for inline run properties like bold). A wrapper would round out the doc-shaping surface alongside --page-width, --margin-*, table column-widths (#631), etc.
Use case
Tag-style badges in header tables of structured documents. For example: a header table where one row names a category and the value cell should carry a stable, consistent colour per category (pale background + bold text) so a reader can scan and immediately see which slice of the org a doc belongs to. Today this requires hand-styling via Drive UI on every doc — a per-doc tax that scales badly.
Proposed surface
gog docs cell-style <docId> \
--tab <title-or-id> \
--table-index N # 0-based ordinal among tables in the tab
--row R --col C # 0-based cell coordinate
--background-color <#hex> # optional; maps to tableCellStyle.backgroundColor
--bold # optional; applies updateTextStyle bold=true to cell contents
--italic --underline # optional; same shape
--text-color <#hex> # optional; maps to textStyle.foregroundColor
A range form would be nice for badge bars: --row 0 --col 0:3 styles three adjacent cells.
Underlying API
documents.batchUpdate → updateTableCellStyle with tableCellStyle.backgroundColor.color.rgbColor and tableRange / tableCellLocation
documents.batchUpdate → updateTextStyle with textStyle.bold / .italic / .underline / .foregroundColor and a content range spanning the cell
Workaround today
Drive UI styling (manual, doesn't survive find-replace round-trips). No CLI path.
Related
Summary
gog docsexposes no way to apply visual formatting to specific table cells. The underlying Google Docs API does expose this viaupdateTableCellStyle(for cell-level properties likebackgroundColor) andupdateTextStyle(for inline run properties likebold). A wrapper would round out the doc-shaping surface alongside--page-width,--margin-*, table column-widths (#631), etc.Use case
Tag-style badges in header tables of structured documents. For example: a header table where one row names a category and the value cell should carry a stable, consistent colour per category (pale background + bold text) so a reader can scan and immediately see which slice of the org a doc belongs to. Today this requires hand-styling via Drive UI on every doc — a per-doc tax that scales badly.
Proposed surface
A range form would be nice for badge bars:
--row 0 --col 0:3styles three adjacent cells.Underlying API
documents.batchUpdate→updateTableCellStylewithtableCellStyle.backgroundColor.color.rgbColorandtableRange/tableCellLocationdocuments.batchUpdate→updateTextStylewithtextStyle.bold/.italic/.underline/.foregroundColorand a content range spanning the cellWorkaround today
Drive UI styling (manual, doesn't survive find-replace round-trips). No CLI path.
Related