open-ui icon indicating copy to clipboard operation
open-ui copied to clipboard

Add the ability to show/hide table rows/columns in a <table>

Open scottkellum opened this issue 1 year ago • 5 comments

A native ability to show/hide rows/columns in a table. A quick search shows other requests for this feature:

  • https://stackoverflow.com/questions/455958/hide-show-column-in-a-html-table
  • https://stackoverflow.com/questions/2858339/show-hide-html-table-columns-using-css
  • @simevidas brought this idea up on Mastodon: https://mastodon.social/@simevidas/110897360588866597

Possible solution: an attribute on a

or like collapsable="true" with a ::marker pseudo element containing a symbol or label.

Open question: What does a collapsed row/column look like on the page, in the DOM, and how might it be styled?

scottkellum avatar Aug 16 '23 16:08 scottkellum

Goals: Gauge appetite for this functionality and OpenUI’s appetite for creating an explainer/alignment on a proposal.

scottkellum avatar Aug 16 '23 17:08 scottkellum

We should reuse existing tech as much as possible. We have <col> for representing columns, so this could be as simple as allowing hidden or display: none to work properly on them.

LeaVerou avatar Aug 16 '23 22:08 LeaVerou

this concept / pattern would likely need to be exposed as a treegrid to follow current expectations/interactions on how such a pattern should be exposed to users and behave.

a thing to not though is that treegrids behave rather poorly on macOS and iOS in particular - as iOS VO doesn't allow for navigation by rows.

a potential alternative there would be that - if such functionality were to automagically become available - that the UA would actually produce a column of toggle buttons so that one could effectively expand/collapse the row's sibling content without having to worry about these current oddities / the fact that if the AT were to change, it would likely be at a differnet pace than the browser, making a weird middle period of browser support vs AT support.

Or, optionally the decision to render the disclosure triangles as individual buttons vs markers could be up to the browser (so long as the way to style them was consistent from a developer's point of view). Then, regardless of whether the treegrid pattern is actually supported on the different platforms, that wouldn't matter as much so long as the pattern was exposed in a way that was familiar / accessible to users of that platform.

scottaohara avatar Aug 16 '23 22:08 scottaohara

The Open UI Community Group just discussed Add the ability to show/hide table rows/columns in a <table>, and agreed to the following:

  • RESOLVED: land a <table> UI enhancements explainer, which OpenUI will tackle.
The full IRC log of that discussion <hdv> gregwhitworth: I did a quick search on WHATWG, wouldn't be shocked if these issues were opened somewhere
<masonf> q?
<masonf> q+
<masonf> ack jarhar
<hdv> gregwhitworth: what Scott is looking at there, and what another issue referred to (search in table)… more often than not if people do this they would completely rebuild tables with `div`s
<hdv> gregwhitworth: he's coming to Open UI because there is some sort of anatomy to this
<hdv> gregwhitworth: my question is… is this the right forum? or is this something that is an 'enhancement to HTML', which could be discussed directly at WHATWG?
<Luke> q?
<Luke> q+
<hdv> gregwhitworth: so what I want resolution on today is where to discuss this… then if we go into the issue itself I'd prefer Scott to be there
<hdv> masonf: my opinion on that question is… I think this is the right forum for that
<hdv> masonf: the bar is, do we need a lot of discussion for this? if there isn't, go directly to WHATWG, if there is, then Open UI is better
<hdv> masonf: there's a lot to be discussed in this use case
<hdv> masonf: it's not just, like, an attribute that the user agent would then take care of, there's a lot of author land stuff
<gregwhitworth> q+
<masonf> q?
<masonf> ack masonf
<hdv> masonf: another question… this issue and the next one says specifically `table`, but what about CSS Grid? whole other can of worms haha
<masonf> ack Luke
<hdv> Luke: I think Open UI is probably the best place to discuss that
<hdv> Luke: a carousel is quite a common component, but not necessarily a singular component, more of a use elements together
<hdv> Luke: I would say it's worth discussing here
<masonf> ack greg
<hdv> Luke: data tables I've implemented as a developer in maybe six ways, all with their own accessibility implications, so a lot to think about
<hdv> gregwhitworth: very related, but side tangent… we maybe need to rework our working model…
<hdv> gregwhitworth: I liked what you said about Open UI vs other groups… would love to cement that
<masonf> Proposed resolution: land a <table> UI enhancements explainer, which OpenUI will tackle.
<masonf> ?
<hdv> masonf: If you read the sidebar on the Open UI website there is a lot of false hope there
<hdv> Luke: what about follow up issues…what to do about stale explainers?
<Luke> +1
<scotto_> +1
<hdv> +1
<masonf> RESOLVED: land a <table> UI enhancements explainer, which OpenUI will tackle.

css-meeting-bot avatar Aug 24 '23 18:08 css-meeting-bot

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

github-actions[bot] avatar Feb 23 '24 00:02 github-actions[bot]