# UnifiedWriter v5.31.0 Table Editing Foundation

## Scope

v5.31.0 builds on the v5.30.0 table-preservation and DOCX Level 3 import work.  The goal is not yet a full Microsoft Word table editor, but a safe Model-first table editing foundation that lets users manipulate real table blocks without falling back to browser `contenteditable` mutation.

## Implemented

- Insert table with configurable rows and columns.
- Select a table cell by clicking it.
- Edit selected cell text through a jQuery UI dialog.
- Insert row above / below the selected cell.
- Insert column left / right of the selected cell.
- Delete selected row.
- Delete selected column.
- Delete the whole table.
- Preserve table selection through undo/redo snapshots where possible.
- Keep table operations routed through the DocumentModel, not direct rendered-DOM mutation.

## Design notes

Table selection is stored separately from normal text `ModelSelection`.  This avoids treating a table as a paragraph-like text block before cell ranges, row ranges and table object selection are fully modelized.  The rendered cell receives a visual selection class, but the authoritative target remains `{ blockId, row, col }`.

Cell text editing is intentionally dialog-based in this milestone.  Inline table-cell editing requires a stronger SelectionController capable of entering and leaving nested cell text surfaces while still keeping the table block as the model source of truth.

## Next table milestones

- Cell range selection.
- Shift-click selection.
- Keyboard movement between cells.
- Cell-level inline formatting.
- Row/column sizing.
- Cell borders, shading and width editing.
- Cell merge / split.
- DOCX table export and higher fidelity DOCX table round-trip.
