Describe the bug
elements in Table and TreeTable components lack proper header associations, causing the _td-has-header_ accessibility rule to fail.
Affected components:
Table (p-table)
TreeTable (p-treetable)
References:
axe rule: td-has-header
WCAG: 1.3.1 Info and Relationships (Level A)
Pull Request Link
#19636
Reproducer
https://stackblitz.com/edit/github-hrd4vzvf?file=src%2Fapp%2Fapp.component.ts
Environment
A library that wraps primeng and provide its own styling.
Angular version
21
PrimeNG version
v21
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
- Open the Table demo page (e.g., Basic Table example)
- Run an accessibility audit using browser DevTools (Lighthouse) or axe DevTools extension
- Observe the td-has-header violation is reported
Or manually:
- Open browser DevTools
- Inspect any element in the table header
- Notice the scope attribute is missing
Expected behavior
All elements in Table and TreeTable should have scope="col" attribute automatically applied, ensuring:
- Screen readers announce column headers when navigating to data cells
- The td-has-header axe accessibility rule passes
- WCAG 1.3.1 (Info and Relationships) compliance is met
Describe the bug
elements in Table and TreeTable components lack proper header associations, causing the _td-has-header_ accessibility rule to fail.Affected components:
Table (p-table)
TreeTable (p-treetable)
References:
axe rule: td-has-header
WCAG: 1.3.1 Info and Relationships (Level A)
Pull Request Link
#19636
Reproducer
https://stackblitz.com/edit/github-hrd4vzvf?file=src%2Fapp%2Fapp.component.ts
Environment
A library that wraps primeng and provide its own styling.
Angular version
21
PrimeNG version
v21
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
Or manually:
Expected behavior
All elements in Table and TreeTable should have scope="col" attribute automatically applied, ensuring: