I have one table in my web page. It has column headers as well as row headers. In every cell there is a checkbox. It's not possible to provide visual labels to all the check boxes, so I am providing the labels using 'aria-label' property. When I am navigating using the table shortcut keys (Alt+Ctrl+Arrow keys) the screen reader is announcing- row headers, column headers and 'aria-label' text. Eg.'Action 1 checkbox not checked select action 1 for all event column 2', which is redundant.
So if I remove both the table headers, screen reader will announce only 'aria-label' text, which is meaningful and enough to identify the purpose of the checkbox. But as per the WCAG guideline(1.3.1 Info and relationship) table must have header associated with the table data.
So here are my questions:
If I remove the table headers- Will it violate the WCAG compliance?. What is the interaction of the screen reader users with table?, Do they always need headers for navigation?. Will the screen reader users be able to complete the table activity by hearing 'aria-label' text only?.
Please see the code snippet:
<table>
<tr>
<th scope="col" width="40%">Events</th>
<th scope="col" align="left">Action 1</th>
<th scope="col" align="left">Action 2</th>
<th scope="col" align="left">Action 3</th>
</tr>
<tr>
<th scope="row">Select All</th>
<td><input type="checkbox" name="Action11" id="Action11" aria-label="Select action 1 for all event" /></td>
<td><input type="checkbox" name="Action12" id="Action12" aria-label="Select action 2 for all event" /></td>
<td><input type="checkbox" name="Action13" id="Action13" aria-label="Select action 3 for all event" /></td>
</tr>
<tr>
<th scope="row">Event 1</th>
<td><input type="checkbox" name="Action21" id="action21" aria-label="Select action 1 for event 1" /></td>
<td><input type="checkbox" name="Action22" id="action22" aria-label="Select action 2 for event 1" /></td>
<td><input type="checkbox" name="Action23" id="Action23" aria-label="Select action 3 for event 1" /></td>
</tr>
<tr>
<th scope="row">Event 2</th>
<td><input type="checkbox" name="Action31" id="action31" aria-label="Select action 1 for event 2" /></td>
<td><input type="checkbox" name="Action32" id="action32" aria-label="Select action 2 for event 2" /></td>
<td><input type="checkbox" name="Action33" id="Action33" aria-label="Select action 3 for event 2" /></td>
</tr>
</table>
Thanks in advance!