diff --git a/.jules/palette.md b/.jules/palette.md
index 74cddb7ad..935f31112 100644
--- a/.jules/palette.md
+++ b/.jules/palette.md
@@ -19,3 +19,6 @@
## 2024-07-13 - CLI Debugging Stack Traces
**Learning:** Adding a `FAST_MLSIRM_DEBUG` bypass to user-friendly `try/except` blocks is crucial for DX. Otherwise, unexpected runtime errors during development will be swallowed into generic stderr messages, hiding the stack trace needed to actually fix the bug.
**Action:** When adding `try-except` blocks to Python CLI subcommands to improve Developer Experience (DX) by preventing raw tracebacks for users, include a debug bypass (e.g., `if os.environ.get("FAST_MLSIRM_DEBUG"): raise`) in *all* catch blocks (including `RuntimeError` and `Exception`) to ensure tracebacks aren't swallowed during local development and debugging.
+## 2026-07-18 - Improve Table Accessibility and Alignment
+**Learning:** When generating HTML data tables, using `
` for the first identifying column improves screen reader accessibility. Additionally, applying `font-variant-numeric: tabular-nums;` to table cells ensures numbers align properly in columns.
+**Action:** Use ` | ` for row headers and `font-variant-numeric: tabular-nums` for numeric data cells in tabular data representations.
diff --git a/python/fast_mlsirm/report.py b/python/fast_mlsirm/report.py
index 30ee4276b..ab50e638d 100644
--- a/python/fast_mlsirm/report.py
+++ b/python/fast_mlsirm/report.py
@@ -317,10 +317,13 @@ def _table(rows: list[dict[str, Any]], *, label: str, limit: int = 12) -> str:
columns = _columns(rows)
body_rows = []
for row in rows[:limit]:
- cells = "".join(
- f" | {escape(_format_value(row.get(column, '')))} | "
- for column in columns
- )
+ cells = ""
+ for i, column in enumerate(columns):
+ val = escape(_format_value(row.get(column, "")))
+ if i == 0:
+ cells += f'{val} | '
+ else:
+ cells += f"{val} | "
body_rows.append(f"{cells}
")
note = ""
@@ -687,13 +690,23 @@ def _css() -> str:
white-space: nowrap;
}
-th {
+td,
+tbody th {
+ font-variant-numeric: tabular-nums;
+}
+
+thead th {
background: #f1f4ef;
color: #2f3437;
font-size: 0.8rem;
}
-tr:last-child td {
+tbody th {
+ font-weight: normal;
+}
+
+tr:last-child td,
+tr:last-child th {
border-bottom: 0;
}