Skip to content

[css-tables][css-backgrounds] Does background-clip work on table columns and rows? #9916

@Loirooriol

Description

@Loirooriol

https://drafts.csswg.org/css-tables/#drawing-cell-backgrounds

In addition to its own background, table-cell boxes also render the backgrounds of the table-track and table-track-group boxes in which they belong. This is actually different from simply inheriting their background because the background-origin and background-size computations will actually be done on the bounds of the grouping boxes, and not on those of the cell.

What about the background-clip of the grouping boxes? Do they use the border and padding of the cell? https://drafts.csswg.org/css-backgrounds-3/#background-clip

<!DOCTYPE html> <style> table { border-spacing: 5px } col { background: linear-gradient(to bottom, rgba(0, 255, 255, 0.5), rgba(255, 255, 0, 0.5)) content-box } tr { background: linear-gradient(to right, rgba(0, 255, 255, 0.5), rgba(255, 0, 255, 0.5)) content-box } td { padding: 10px; border: 10px solid rgba(0, 0, 0, 0.2); } td:nth-of-type(1) { border-width: 10px } td:nth-of-type(2) { border-width: 5px } td:nth-of-type(3) { border-width: 0px } tr:nth-of-type(1) > td { padding: 10px } tr:nth-of-type(2) > td { padding: 5px } tr:nth-of-type(3) > td { padding: 0px } </style> <table> <col></col> <col></col> <col></col> <tr><td>A</td><td>B</td><td>B</td></tr> <tr><td>A</td><td>B</td><td>B</td></tr> <tr><td>A</td><td>B</td><td>B</td></tr> </table>
Gecko Blink WebKit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Tuesday afternoon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions