From 4c9df71ce9b7739b21c5fffcfdb20d7dd8ffeebd Mon Sep 17 00:00:00 2001 From: Mohammadali Masjedi Date: Tue, 14 Jul 2026 14:13:44 +0200 Subject: [PATCH] docs: fix stale table.direction example to table_direction The WD_TABLE_DIRECTION example showed `table.direction = WD_TABLE_DIRECTION.RTL`, but the actual property is `Table.table_direction`. Plain `table.direction = ...` is a silent no-op: it sets an ordinary attribute, raises nothing, and never writes ``, so users believe RTL was applied when it wasn't. Fixes the example in both the enum docstring and the hand-maintained .rst reference. Co-Authored-By: Claude Opus 4.8 --- docs/api/enum/WdTableDirection.rst | 2 +- src/docx/enum/table.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/enum/WdTableDirection.rst b/docs/api/enum/WdTableDirection.rst index 9a7b66c45..c93a60b92 100644 --- a/docs/api/enum/WdTableDirection.rst +++ b/docs/api/enum/WdTableDirection.rst @@ -11,7 +11,7 @@ Example:: from docx.enum.table import WD_TABLE_DIRECTION table = document.add_table(3, 3) - table.direction = WD_TABLE_DIRECTION.RTL + table.table_direction = WD_TABLE_DIRECTION.RTL ---- diff --git a/src/docx/enum/table.py b/src/docx/enum/table.py index eb1eb9dc0..9195ccae8 100644 --- a/src/docx/enum/table.py +++ b/src/docx/enum/table.py @@ -116,7 +116,7 @@ class WD_TABLE_DIRECTION(BaseEnum): from docx.enum.table import WD_TABLE_DIRECTION table = document.add_table(3, 3) - table.direction = WD_TABLE_DIRECTION.RTL + table.table_direction = WD_TABLE_DIRECTION.RTL MS API name: `WdTableDirection`