Skip to content

feat(docs): cell-style — set tableCellStyle (backgroundColor) and inline textStyle (bold) on table cells #645

Description

@sebsnyk

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.batchUpdateupdateTableCellStyle with tableCellStyle.backgroundColor.color.rgbColor and tableRange / tableCellLocation
  • documents.batchUpdateupdateTextStyle 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions