w3c / w3c/csswg-drafts

[css-display] Make `table-caption` and `table-cell` <display-outside> values

Open
#3,940 16 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css-display-4 css-tables-3
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

Splitting out from @MatsPalmgren's comment in https://github.com/w3c/csswg-drafts/issues/3771:

Random thought: maybe marker should be a display value rather than a position value.

It should be a new <display-outside> value, or an additional keyword, in that case. I think it would ruin this feature if you can't specify the marker's internal layout to be grid etc. Compare table-caption/cell, which has severely limited layout because you can't specify a <display-inside> value.

::marker, table-caption, <legend> and <summary> have a lot in common in this respect. They are in-flow by default, but not quite, since they aren't flowed normally together with other children in the layout context. Semantically, they're like a third variation of "flow" (besides in-flow, out-of-flow). I wonder if we should model them in the same way for that reason. Either through <display-outside> or a new property. E.g.

<display-outside> = block | inline | run-in | marker | caption | cell | legend | summary

This would add a lot more power to authors to control the layout without having to add wrapper elements. E.g. <caption> would have display: caption flow-root by default, but you could also specify <caption style="display: caption grid"> to display its children using Grid layout.
legend | summary allows an arbitrary child to be displayed as the rendered legend/summary in a fieldset/details element.

(FYI, It would be trivial to support table captions/cells with internal grid/flex/table layout in Gecko. The only thing missing is some way to specify it in CSS.)

It would be trivial to make table-caption a <display-outside> value in the spec, too. Should we do it? (By which I mean, does anyone actually want to implement it?)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CSS Display 3 definition and the linked discussion in issue #3771. Review how table-caption and table-cell are currently specified, then determine the wording and interoperability concerns needed for a Working Group resolution. Done means the proposal has consensus and the relevant specification text is updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.