interop icon indicating copy to clipboard operation
interop copied to clipboard

Border color for tables

Open atjn opened this issue 1 year ago • 1 comments

Description

If I am writing a document with tables, I would like my table borders to be the same color as my text (by default):

Image of tables that are rendered in the same color as the sorrounding text

This works in Firefox but in Chrome, Edge, and Safari it looks like this:

Image of tables that are rendered in the same color as the sorrounding text, except that the outer border of the table is grey no matter what

It would be really nice if engines could standardize this behavior.

WPT tests to include

This issue is tested by the following two tests that should be included in Interop 2025:

Specification

border-color's initial value should be currentcolor: https://www.w3.org/TR/css-backgrounds-3/#border-color

There are no recommended stylesheets that override that value for tables: https://html.spec.whatwg.org/multipage/rendering.html#tables-2

Additional Signals

Workarounds

Many websites include a CSS reset that forces the behavior seen in Firefox. Here are two examples of popular CSS reset libraries doing that:

  • https://github.com/sindresorhus/modern-normalize/blob/3faa07fc91b8ffbe6243bc4f91e880a00185d0a2/modern-normalize.css#L109..L115
  • https://github.com/csstools/normalize.css/blob/23b18687d9bbaa8ef108064cd3f11c0941ec697e/normalize.css#L93..L101

Browser bugs

There are long standing bugs to fix this issue for both engines:

Historical note

Chromium and Webkit sets a grey border color because it provided interoperability with old versions of Internet Explorer. The rule was previously part of the HTML spec but was removed in 2019: https://github.com/whatwg/html/pull/4398

atjn avatar Sep 18 '24 10:09 atjn

Related proposal: #727

atjn avatar Sep 19 '24 07:09 atjn

Thank you for proposing Border color for tables for inclusion in Interop 2025.

We wanted to let you know that this proposal was not selected to be part of Interop this year.

On behalf of the entire Interop team, thank you for submitting this proposal for consideration. We got many more proposals than we could include in this year's project, necessitating some difficult choices. Please note this should not be taken as a comment on the technology as a whole, or our willingness to consider it for Interop in the future. We appreciate the work you put into your proposal, and would welcome your participation in future rounds of Interop.

For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2025.

Posted on behalf of the Interop team.

wpt-interop avatar Feb 13 '25 17:02 wpt-interop