Skip to content

[css-tables-3] How table borders should be painted at the corner? (border-collapse: collapse) #13406

Open

Description

@karlcow

Currently the painting at the corner of collapse borders differs in between Chrome/Safari and Firefox.

This is easily visible with larger borders.
Image

As you can see, chrome and Safari adds the opacity on top of each other, while Firefox doesn't have this rendering because the corners are painted in diagonal (like a real wood painting frame assemblage)

But which is correct?
I didn't find anything in the specification explaining how it should be done.
https://drafts.csswg.org/css-tables-3/#conflict-resolution-for-collapsed-borders

https://codepen.io/webcompat/pen/XJKVezR

<style>
  td {
    width: 50px;
    height: 50px
  }

  table {
    border-collapse: collapse;
    margin: 10px
  }
</style>
<table>
  <tbody>
    <tr>
      <td style="
           border-left: 20px solid rgba(0, 127, 0, 0.5); 
           border-bottom: 20px solid rgba(0, 127, 0, 0.5);"></td>
    </tr>
  </tbody>
</table>

<table>
  <tbody>
    <tr>
      <td style="
           border-left: 20px solid rgba(0, 127, 0, 0.5); 
           border-bottom: 20px solid rgba(127, 0, 0, 0.5);"></td>
    </tr>
  </tbody>
</table>

Activity

  1. karlcow commented on Jan 28, 2026

    @karlcow
    MemberAuthor

    If painting on top of each other, there will be also the issue of the painting order which will matter. Which border will win over the other side.

  2. keithamus commented on Jan 29, 2026

    @keithamus
    Member

    Right. I'm inclined to say Firefox's "clean mitres" is right here because this matches how borders generally work in non-table painting.

    (FWIW Firefox's draw code for borders, Chrome's code for collapsed borders, Webkit's code for collapsed borders).

    Of note WebKit has a comment:

    We never paint diagonals at the joins. We simply let the border with the highest precedence paint on top of borders with lower precedence.

    I don't know the history here, but I'd wager Chrome's lineage to WebKit is why the two behave the same.

  3. Loirooriol commented on Jan 29, 2026

    @Loirooriol
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions