-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve table caption accessibility #41502
Comments
@tellthemachines thanks so much! One nice discussion and result at the WordCamp Europe contributor day :-) |
I can start working on it. So we want this? Old: <figure class="wp-block-table">
<table>
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</tbody>
</table>
<figcaption>Test</figcaption>
</figure> New: <table class="wp-block-table">
<caption>Test</caption>
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</tbody>
</table> |
@Soean, yes please. |
Will caption be optional? Sometimes content writers choose for a heading (h2...h6) just before a table for reasons. What you don't want is double texts (or texts that are read out twice by a screenreader). |
Yes, the caption will be optional |
RichText limitations weren't the only problems, there were a couple of additional bugs:
It's definitely worth re-testing those two things as there may have been changes in Gutenberg and VO that mean they are no longer issues. |
What problem does this address?
Table block originally implemented captions as
figcaption
elements, due to limitations with RichText output discussed here: #15554These limitations no longer apply, so nothing prevents us from using an actual table
caption
element instead. This makes tables more accessible for screen readers, as the caption content will be announced at the start of the table.What is your proposed solution?
Change the table block markup to use
caption
as first element within thetable
element, instead of the currentfigcaption
.Consider adding a default content to the caption, such as we have on Navigation block name: Table 1, Table 2, etc..
The text was updated successfully, but these errors were encountered: