table · genspark-ai, guides — промпт для Claude Code: что делает и как установить
Промпт table объясняет агенту, когда в Excel-файле ставить настоящую таблицу Excel, а когда сымитировать её вид обычным диапазоном.
Apache-2.0 ★ 12 746 обновлён 2026-10-29
.claude/commands/table.mdЧто делает table
Промпт для Claude Code описывает операцию add_table: заголовки и данные сначала пишутся через set_range/set_cell, затем диапазон превращается в таблицу с названием, стилем (TableStyleLight1..21, TableStyleMedium1..28, TableStyleDark1..11) и чередующейся закраской строк. Пустые заголовки агент заполнит как Column1/Column2, дубликаты получат числовые суффиксы.
Дальше таблицу можно расширять операциями add_table_row, delete_table_row, add_table_column, delete_table_column без промежуточного сохранения файла — но это работает только для таблиц, созданных в текущей сессии через add_table. Таблицы, которые уже были в файле при открытии, этими операциями не трогаются: агент попросит пользователя сохранить и переоткрыть файл.
Промпт описывает структурированные ссылки вида TableName[Column] и TableName[#Data] — имена таблиц и столбцов регистрозависимы и должны совпадать с тем, что выдаёт get_sheet_features. Для нерегулярных данных с подытогами или составными заголовками предлагается запасной план: закраска через format_range, чередование строк через условное форматирование с формулой MOD(ROW(),2)=0 и фильтр через set_filter вместо настоящей таблицы.
Какие задачи решает
- превратить диапазон с заголовком и данными в таблицу Excel
- добавить или удалить строки и столбцы внутри уже созданной таблицы
- настроить фильтр и чередующуюся закраску строк без ручной верстки
- сослаться на столбец таблицы структурированной ссылкой вида
TableName[Column] - сымитировать вид таблицы на нерегулярных данных с подытогами
Примеры запросов агенту
- Сделай из диапазона A1:C20 таблицу Excel с именем SalesDetail
- Добавь в таблицу SalesDetail два новых столбца с заголовками Notes и Status
- Преврати диапазон A1:D100 в таблицу с чередующейся закраской и фильтром на первой строке
Как установить table
Вручную: положить файлы
.claude/commands/table.mdКак использовать
Вставьте текст в начало диалога или в инструкции проекта
Вопросы о table
Как установить table в Claude Code?
Нужно добавить файл .claude/commands/table.md в проект.
Что делает промпт table?
Он задаёт агенту правила работы с таблицами Excel: когда создавать настоящую таблицу через add_table, как расширять её строками и столбцами, и как заменить таблицу обычным диапазоном с закраской и фильтром, если данные нерегулярные.
Можно ли менять строки и столбцы таблицы, которая уже была в файле?
Нет, операции add_table_row, delete_table_row, add_table_column и delete_table_column работают только с таблицами, созданными через add_table в текущей сессии. Для таблиц из открытого файла нужно сохранить и переоткрыть его.
Исходный текст
table.md · Apache-2.0
# Structured table guide (table)
## When to use a structured table
When the data is a regular "header + homogeneous record rows" shape, prefer a Table: automatic banded fill, filter dropdowns, and after saving a native table object in Excel (auto-expansion, structured references).
## Creating a table (add_table)
`{op:"add_table", sheetId, range:"A1:D10", name?, style?, bandedRows?}`
- **The first row of range must be headers**: write the headers and data with set_range/set_cell first, then add_table. Headers must be non-empty and mutually unique — empty headers are auto-filled as Column1/Column2, duplicate headers get numeric suffixes, and both are written back into the cells.
- range needs at least two rows (header + ≥1 data row) and must not overlap merged cells, existing tables, or a worksheet filter (set_filter) region — conflicts are rejected at save time.
- name: table name (starts with a letter/underscore, may contain Chinese; unique within the workbook, shares a namespace with defined names). **Always naming explicitly is recommended**; defaults to Table1, Table2… (if it collides with a table already in the file, saving errors).
- style: built-in styles `TableStyleLight1..21` / `TableStyleMedium1..28` / `TableStyleDark1..11`, default `TableStyleMedium2`.
- bandedRows: banded fill, default true.
```json
[
{
"op": "set_range",
"sheetId": "s1",
"range": "A1:C1",
"values": [["Product", "Quantity", "Amount"]]
},
{
"op": "add_table",
"sheetId": "s1",
"range": "A1:C20",
"name": "SalesDetail",
"style": "TableStyleMedium2"
}
]
```
Notes:
- After creating the table you can extend its structure directly with `add_table_row` / `add_table_column` etc., no save needed first. But tables that came with the file (existed at open time) cannot be modified with these ops — ask the user to save and reopen.
- Don't merge_cells inside table data; don't stack set_filter on the header row (the table has its own filter).
## Structured references
The engine evaluates Excel structured references for every table listed by get_sheet_features (file tables and tables added this session), on the same sheet or on another sheet:
- `TableName[Column]`, `TableName[[ColA]:[ColB]]`, `TableName[#All]`, `TableName[#Headers]`, `TableName[#Data]`, `TableName[[#This Row],[Column]]` (only inside the table's own rows).
- Table and column names are matched **case-sensitively** — copy them exactly as get_sheet_features lists them.
Not supported (write a plain A1 range instead): the `[@Column]` / `TableName[@Column]` shorthand, sheet-qualified table names (`Sheet1!Table[Col]`), `[#Totals]` (a file table's totals row is outside the registered range), and tables that have no header row.
## Inserting/deleting rows and columns
> **Precondition**: these four operations only work on **tables created this session via add_table**; tables that came with the file are unsupported (error: please save and reopen before modifying).
### add_table_row — insert data rows
```json
{ "op": "add_table_row", "sheetId": "s1", "tableName": "SalesDetail", "row": 3, "count": 2 }
```
- `row` (optional, 1-based, relative to the data area): insert position; omitted = append at the end.
- `count` (optional, default 1): number of rows to insert, 1–1000.
- After the operation, fill the new rows with set_range/set_cell.
### delete_table_row — delete data rows
```json
{ "op": "delete_table_row", "sheetId": "s1", "tableName": "SalesDetail", "row": 2, "count": 1 }
```
- `row` (required, 1-based): first row to delete (relative to the data area, excluding the header).
- `count` (optional, default 1): number of rows to delete.
- At least 1 data row must remain; deleting them all is rejected.
### add_table_column — insert columns
```json
{
"op": "add_table_column",
"sheetId": "s1",
"tableName": "SalesDetail",
"column": 3,
"columnName": "Notes",
"count": 1
}
```
- `column` (optional, 1-based): insert position; omitted = append at the far right.
- `columnName` (required): header name of the new column; must not duplicate an existing column in the table.
- `count` (optional, default 1): number of columns to insert. When count>1, subsequent column names get numeric suffixes (Notes, Notes2…).
### delete_table_column — delete columns
```json
{
"op": "delete_table_column",
"sheetId": "s1",
"tableName": "SalesDetail",
"column": 4,
"count": 1
}
```
- `column` (required, 1-based): first column to delete (relative to the table's left edge).
- `count` (optional, default 1): number of columns to delete.
- At least 1 column must remain; deleting them all is rejected.
### Typical workflow
1. Create and name the table with `add_table` (**explicit name recommended**).
2. Extend the structure with `add_table_row` / `add_table_column`, then fill data with `set_range` / `set_cell`.
3. When done, remind the user to save (⌘S); after saving, the table ref in the file updates automatically.
## Fallback plan (when a real table doesn't fit)
When the data is irregular (subtotal rows, merged multi-column headers), don't create a Table — simulate the look with a plain range:
```json
[
{
"op": "format_range",
"sheetId": "s1",
"range": "A1:D1",
"format": { "bold": true, "fillColor": "#4472C4", "fontColor": "#FFFFFF" }
},
{
"op": "add_conditional_format",
"sheetId": "s1",
"range": "A2:D100",
"rule": {
"kind": "formula",
"formula": "=MOD(ROW(),2)=0",
"format": { "fillColor": "#F2F7FF" }
}
},
{ "op": "set_filter", "sheetId": "s1", "range": "A1:D100" }
]
```
- Banded fill via a `MOD(ROW(),2)` conditional format (adapts automatically to row insertion/deletion).
- A filter on the first row (`set_filter`) approximates the Table's filter dropdowns.
## Deleting a table (delete_table)
`{op:"delete_table", sheetId, tableName}` — only tables created this session via add_table can be deleted; the semantics are "convert to a plain range": values and formats are kept, only the Table object is removed (style banding/filter disappear with it). Tables that came with the file cannot be deleted.
© genspark-ai · Apache-2.0 · genspark-ai/genoffice
Похожие промпты
Все промпты по теме «Документы и офис» →Сначала — table от других авторов.