CSS Subgrid Layout Builder - Online Align Nested Grids
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
UD5 Toolkit
empty-cells Property DemoInteractive demonstration of how empty-cells controls the visibility of empty table cell borders and backgrounds. Edit cells, toggle modes, and see the real-time difference between show and hide.
| Name | Math | English | Science |
|---|---|---|---|
| Alice | 85 | 92 | |
| Bob | 78 | 88 | |
| Charlie | 90 | ||
| Diana | 76 | 85 | 91 |
| Name | Math | English | Science |
|---|---|---|---|
| Alice | 85 | 92 | |
| Bob | 78 | 88 | |
| Charlie | 90 | ||
| Diana | 76 | 85 | 91 |
/* Table with empty-cells: show (default) */
table {
empty-cells: show;
border-collapse: separate;
border-spacing: 6px;
}
/* Table with empty-cells: hide */
table {
empty-cells: hide;
border-collapse: separate;
border-spacing: 6px;
}
empty-cells property only works with border-collapse: separate (the default).
When border-collapse: collapse is active, empty-cells has no effect — both tables will look identical.
Toggle the "Collapse Borders" switch above to see this in action. Also note: a cell containing or any whitespace is not considered empty.
The empty-cells CSS property controls whether borders and backgrounds are rendered around empty table cells (cells with no visible content). It applies to <td> and <th> elements within a table that uses border-collapse: separate. This property is part of the CSS 2.1 specification and is supported by all modern browsers.
It accepts two keyword values:
show (default) — Empty cells display their borders and backgrounds normally, just like filled cells.hide — Empty cells' borders and backgrounds are completely hidden, making the cell appear invisible (though it still occupies space in the layout).A cell is considered empty only if it contains absolutely no content — no text, no child elements, no , and no whitespace characters (including spaces and line breaks). Even a single or a zero-width space makes the cell "non-empty," and empty-cells: hide will not hide it. The browser checks the cell's inner content; if textContent.trim() is '', it's empty.
No. The empty-cells property only takes effect when border-collapse: separate is set (which is the default for HTML tables). In collapse mode, borders are merged into a single border between adjacent cells, and the concept of individual cell borders doesn't apply — so empty-cells is ignored entirely. Use the toggle switch in the demo above to verify this behavior.
Use the CSS declaration empty-cells: hide; on your <table> element, and ensure border-collapse: separate; is active. For even more control, you could use JavaScript to detect empty cells and apply visibility: hidden; or remove them from the DOM entirely. However, empty-cells: hide is the simplest, native CSS solution for hiding borders and backgrounds of empty cells while preserving table structure.
Common scenarios include:
empty-cells has excellent browser support. It is supported in all major browsers including Chrome, Firefox, Safari, Edge, and Opera — going back to IE8+. It's a stable CSS 2.1 feature that you can safely use in production without vendor prefixes or fallbacks.
No. empty-cells is a discrete property — it only accepts keyword values (show or hide) with no intermediate states, so CSS transitions and animations cannot interpolate between them. The change is instantaneous. If you need a smooth fade effect for hiding empty cells, you would need to use JavaScript with opacity or visibility transitions instead.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Convert currencies using a built‑in table of approximate fixed rates. Useful for quick estimates without live data. Local.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Paste CSV and get a beautiful HTML table with sortable headers (optional). Copy the full HTML/CSS snippet. Local.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Upload two images and apply CSS blend modes (multiply, screen, overlay, etc.). See the result and copy the filter CSS. Pure frontend.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Create a glowing or rotating border animation around an element. Copy the CSS keyframes. Pure CSS magic.
Create a custom HTML/CSS progress bar with percentage, colors, and animation. Copy the code. Modern UI element.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Find safe mixing ratios for the classic elephant toothpaste demonstration. Volume adjustments for different container sizes.
Recreate the target CSS linear gradient by adjusting stops and colors. A unique game for front‑end developers to master gradients.
Browse and search all Font Awesome 6 icons with preview, class name, and unicode. Copy the HTML snippet. Perfect for web developers.
Create text with a gradient fill using CSS background-clip. Configure colors and direction. Copy the code. Works in modern browsers.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.
Interactive ASCII table showing decimal, hex, octal, and binary codes for all standard and extended ASCII characters. A classic programmer reference.
Minify JavaScript and CSS code to reduce file size for production. Remove whitespace and comments instantly. Run locally, your code stays private.
Easily create asymmetric border radius values and preview the result. Copy the generated CSS instantly. All interactively and browser-based.
Beautify and format your CSS stylesheets instantly. Organize, minify, or prettify CSS code for better readability. Processed securely on client-side.