CSS Grid Layout & Table Rendering: Interoperability of the 'gap' Property
29K reputation · 20 Jan 2024, 20:11 UTC
Goal
The objective is to determine whether the CSS Grid Layout gap property should uniformly apply to table elements, enabling developers to use a single spacing mechanism across grid and tabular contexts.
Constraints
Current browsers (Chrome 96+, Firefox 91+, Safari 15+, Edge 96+) ignore gap when declared on a <table> element, treating it as non‑applicable. The CSS Grid spec allows the property on tables but does not mandate implementation, and no vendor has announced a change. Workarounds such as margin on <td> or pseudo‑elements add markup complexity and may affect performance.
Uncertainty
The specification’s wording on table support remains ambiguous, and it is unclear whether table‑gap support will be added as a separate feature or deferred until a broader CSS Table Layout standard is finalized.
Specific Questions
- Should the
gapproperty be implemented for table elements within the current CSS Grid Layout spec? - If not, what is the recommended approach for developers who require uniform spacing across grid and table layouts?
- Does the spec foresee a distinct feature for table gaps, and what is the timeline for potential implementation?