delete_table
Remove a whole table and its contents from a Word document by table index. Handles nested tables automatically, with backup and refuse to modify open files.
Instructions
Delete a whole table and its contents. table_index is the 0-based position among body-level tables in document order, as reported by list_elements(type='tables') or get_document_view; nested tables are removed with their host table. To clear cell values while keeping the grid, use set_cells instead. Auto-backup: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Refuses documents open in Word.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| backup | No | ||
| file_path | Yes | ||
| table_index | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||