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

Empty table th elements should be replaced with td #840

Closed
peteharverson opened this issue May 17, 2018 · 5 comments · Fixed by #2934
Closed

Empty table th elements should be replaced with td #840

peteharverson opened this issue May 17, 2018 · 5 comments · Fixed by #2934

Comments

@peteharverson
Copy link

If an empty String is used for the name property of a column in an EUI table (found with EuiInMemoryTable), an empty <th> element is created. For accessibility, this empty <th> should be replaced with a <td> (see elastic/kibana#12401).

Example from the ML anomalies table where an empty header is used for the first column holding the row expand control:

image

cc @aphelionz

@cchaos
Copy link
Contributor

cchaos commented Aug 7, 2018

In elastic/kibana#12401, referenced above, the author links to this article for details: https://webaim.org/techniques/tables/data

However, I see no where that it mentions replacing th's with td's. In fact, it explicitly says not to have empty table headers:

Table headers should never be empty. This is particularly of concern for the top-left cell of some tables.

I would call this now a non-fix since it's no longer an approved way of handling empty header cells.

@cchaos cchaos closed this as completed Aug 7, 2018
@shahzad31
Copy link
Contributor

@cchaos i was testing accessibility in Uptime app and i found the same issue with wave accessibility tool
it does actually recommend replacing empty th with td in table header and it is totally a valid tag inside th.
Screenshot 2019-09-01 at 05 39 31

i also found another useful discussion regarding this issue in another component library issue
primefaces/primefaces#4725
i think we can solve it by replacing th with td when name is empty or we can provide an option to use td/th as an option 'component' prop.

also in a more complicated solution, user can also use render method to render custom td, but i think that will be ugly.

@shahzad31 shahzad31 reopened this Sep 1, 2019
@myasonik
Copy link
Contributor

myasonik commented Sep 2, 2019

+1 to replacing empty <th> with <td>.

@cchaos In the same article you posted, the examples on that page use empty tds for tables similar in design to the original issue screen shot. (That is, at least that's the current state of the article. Not sure if it's been updated since last year.)

@anishagg17
Copy link
Contributor

@myasonik i want to work on this issue

@myasonik
Copy link
Contributor

It's yours!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants