Skip to content
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

Table Block: add caption support #11589

Closed
fienen opened this issue Nov 7, 2018 · 5 comments · Fixed by #15554
Closed

Table Block: add caption support #11589

fienen opened this issue Nov 7, 2018 · 5 comments · Fixed by #15554
Assignees
Labels
[Block] Table Affects the Table Block [Feature] Block Transforms Block transforms from one block to another [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@fienen
Copy link

fienen commented Nov 7, 2018

Describe the bug
When creating a table block, you have to manually edit the HTML if you want to include a caption on the table. A <caption> is allowed to be the first child of a <table> element for accessibility purposes as described in https://www.w3.org/WAI/tutorials/tables/caption-summary/ and https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption

To Reproduce
Steps to reproduce the behavior:

  1. Create or edit a post
  2. Insert a table block
  3. Convert to HTML editing
  4. Add a <caption> element just inside the <table> element
  5. Convert back to visual editing

Expected behavior
This should not produce an error, and should be treated as acceptable markup. Bonus points if the table block editor straight up supported captions, as well as thead/tfoot without having to manually editing the HTML of the table.

Screenshots
table1
table2

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 70

Additional context

  • Gutenberg 4.2.0
@designsimply designsimply added Needs Testing Needs further testing to be confirmed. [Feature] Block Transforms Block transforms from one block to another [Block] Table Affects the Table Block labels Nov 7, 2018
@ellatrix ellatrix changed the title Table Block editor treats captions as invalid markup Table Block: add caption support Jun 24, 2019
@ellatrix
Copy link
Member

Right, there is currently no caption support.

@ellatrix ellatrix added [Type] Enhancement A suggestion for improvement. and removed Needs Testing Needs further testing to be confirmed. labels Jun 24, 2019
@talldan talldan mentioned this issue Jul 19, 2019
5 tasks
@talldan talldan added the [Status] In Progress Tracking issues with work in progress label Aug 5, 2019
@talldan talldan self-assigned this Aug 5, 2019
@Rik44444
Copy link

this issue has been closed, but in my Wordpress version 5.5 i do not have caption support in the Table block, is that correct? Or have i missed it?

@michaelmcpeekbrenau
Copy link

One year later and the Tables block still doesn't support captions and doesn't use ARIA labels to connect figcaptions with tables, either.

@talldan
Copy link
Contributor

talldan commented Aug 30, 2021

Table blocks should support captions since WordPress 5.4:
Screenshot 2021-08-30 at 11 13 05 am

@michaelmcpeek The implementation does use a figcaption, but screenreaders should still announce this.

An implementation using the table <caption> element was attempted initially, but unfortunately browsers/assistive technologies didn't seem to support a contenteditable caption element. That might have changed now, so it could be worth looking at again.

#24205 discusses changing the caption implementation (and aria labels aren't the right way to connect a caption to a table).

@betagoo
Copy link

betagoo commented Aug 8, 2022

figcaption is not semantic. It's very big problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Feature] Block Transforms Block transforms from one block to another [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants