What Are Display Internal Values?
The CSS display property is one of the most fundamental properties in Cascading Style Sheets, controlling how an element generates a box in the layout tree. Internal display values are unique in that they only have meaning within specific layout contexts--table and ruby layouts.
When building complex layouts in CSS, understanding the full range of display values is essential. While most developers are familiar with display: block and display: inline, the display property includes a powerful subset of "internal" values designed specifically for specialized layout models.
The Display Architecture
Modern CSS separates display into two conceptual components:
- Outer display type: How the element participates in flow layout
- Inner display type: How its children are laid out
This separation becomes particularly important with display-internal values, where the inner display type defines complex internal structures like tables and ruby annotations.
Two Categories of Internal Display Values
- Table internal values - For tabular data layout (8 values)
- Ruby internal values - For East Asian typography (4 values)
Understanding these values is essential for modern web development, particularly when building data-rich interfaces and internationalized applications. Our web development services team specializes in creating performant, accessible interfaces using these foundational CSS techniques.
Eight specialized values for controlling table structure
table-row-group
Groups table rows like HTML <tbody>. The most common row group type containing main data rows.
table-header-group
Corresponds to <thead>. Always renders at the top, even if defined later in source order.
table-footer-group
Corresponds to <tfoot>. Always renders at the bottom of the table structure.
table-row
Represents a single row like HTML <tr>. Must contain one or more table cells.
table-cell
The content container for table data. Participates in column sizing and alignment.
table-column-group
Groups columns like <colgroup>. Influences styling of entire columns.
table-column
Represents a single column like <col>. Used for column-level styling.
table-caption
Creates table captions like <caption>. Position controlled by caption-side property.
Table Internal Display Values
Table Row Group Values
The table internal display values include three row group types that organize table rows into logical sections:
table-row-group
- Corresponds to HTML
<tbody>element - Represents the primary content body of a table
- Contains the main data rows
table-header-group
- Corresponds to HTML
<thead>element - Reserved for header rows appearing at the table top
- Always renders before all other rows and row groups
- The first header group is treated specially; additional groups render as standard row groups
table-footer-group
- Corresponds to HTML
<tfoot>element - Contains summary rows appearing at the table bottom
- Always renders after all other rows, regardless of source order
- Multiple footer groups: only the first receives special treatment
Table Row and Cell Values
table-row
- Represents a single row like HTML
<tr> - Must contain one or more table cells
- Browser applies "missing cell fixup" by generating anonymous table-cell boxes
table-cell
- Corresponds to
<td>and<th>HTML elements - Represents the actual content containers
- Participates in column sizing
- Supports rowspan and colspan attributes
- Minimum width determined by largest content
- Vertically aligned to baseline by default
These table display values are essential building blocks for creating accessible, well-structured data presentations that work seamlessly with CSS Grid and Flexbox in hybrid layouts.
1/* Creating a table structure with display values */2.table-element {3 display: table;4 width: 100%;5 border-collapse: collapse;6}7 8.table-header {9 display: table-header-group;10 background-color: #f5f5f5;11 font-weight: bold;12}13 14.table-body {15 display: table-row-group;16}17 18.table-footer {19 display: table-footer-group;20 background-color: #fafafa;21 font-weight: bold;22}23 24.table-row {25 display: table-row;26}27 28.table-cell {29 display: table-cell;30 padding: 0.75rem;31 border: 1px solid #ddd;32}Table Column and Caption Values
table-column-group
- Corresponds to HTML
<colgroup>element - Groups one or more columns
- Doesn't generate visible boxes itself
- Influences rendering of cells in associated columns
table-column
- Corresponds to HTML
<col>element - Defines properties for a single column
- Useful for consistent column styling without repeating CSS rules
table-caption
- Corresponds to HTML
<caption>element - Places a caption above or below the table
caption-sideproperty controls position (top, bottom, inline-start, inline-end)- Participates in table width calculations
- Inherits styling from the table element
Form Layout Example
Using display: table, display: table-row, and display: table-cell provides automatic equal-height columns and proper vertical alignment for forms. This technique is particularly useful when building custom form interfaces where consistent alignment is critical:
/* Form layout using table display values */
.form-table {
display: table;
width: 100%;
max-width: 600px;
}
.form-row {
display: table-row;
}
.form-label,
.form-input {
display: table-cell;
padding: 0.75rem;
vertical-align: middle;
}
.form-label {
width: 120px;
font-weight: 500;
}
Implementing proper form layouts contributes to better SEO performance by improving user experience and reducing bounce rates from frustrating interactions.
Ruby Internal Display Values
Understanding Ruby Layout
Ruby annotation is a form of interlinear annotation used in East Asian typography, where small characters (ruby) are placed above or beside base text to provide pronunciation guides or translations. This is essential for:
- Japanese furigana (pronunciation guides above kanji)
- Chinese pinyin annotations
- Korean hanja readings
Ruby Internal Values
ruby-base
- Corresponds to HTML
<rb>element - Represents the base text receiving the annotation
- Inline-level element
- Participates in normal inline layout within ruby container
ruby-text
- Corresponds to HTML
<rt>element - Represents the annotation text
- Typically rendered in smaller font above or beside base
- Position controlled by
ruby-positionproperty
ruby-base-container
- Provides structural grouping for ruby bases
- Generated automatically by browser when needed
- Handles cases where ruby layout spans multiple bases
ruby-text-container
- Groups ruby text elements separately
- Used in complex annotation scenarios
- Generated automatically by browser
For internationalized web applications, supporting ruby layout ensures proper accessibility for East Asian users. Our AI automation services can help streamline localization workflows for multilingual content delivery.
1/* Japanese ruby annotation example */2.ruby-container {3 display: ruby;4}5 6.ruby-base {7 display: ruby-base;8}9 10.ruby-text {11 display: ruby-text;12 font-size: 0.6em;13 ruby-position: over;14}15 16/* HTML equivalent structure */17/*18<ruby>19 <rb>日本語</rb><rt>にほんご</rt>20</ruby>21*/Practical Applications
Creating Form Layouts
One of the most practical applications of table internal display values is creating consistent form layouts. Using display: table, display: table-row, and display: table-cell provides:
- Automatic equal-height columns
- Proper vertical alignment
- Consistent padding and spacing
- Natural responsive reflow
Pricing Tables and Data Display
Display internal values excel when building:
- Pricing tables - With header and summary sections
- Comparison charts - Where cell alignment is critical
- Data-rich components - Requiring tabular presentation
/* Pricing table with table display values */
.pricing-table {
display: table;
width: 100%;
border-collapse: collapse;
margin: 2rem 0;
}
.pricing-header {
display: table-header-group;
background-color: #2c3e50;
color: white;
}
.pricing-row {
display: table-row;
}
.pricing-cell {
display: table-cell;
padding: 1rem;
border: 1px solid #dee2e6;
text-align: center;
}
.pricing-cell.feature-name {
text-align: left;
font-weight: 500;
}
Calendar and Schedule Layouts
The table structure naturally supports calendar layouts where you need a grid of cells with varying content. Display internal values allow creating calendar grids without using HTML table elements, maintaining semantic flexibility.
Combining with Modern Layout Techniques
Display internal values work well with CSS Grid and Flexbox for hybrid layouts. For example, you might use Grid for overall page structure while using table display values for form layouts and data tables within the page. This approach is a hallmark of professional web development services that leverage the right tool for each specific layout challenge.
Browser Support and Compatibility
Current Browser Support
Table internal values enjoy excellent browser support:
- Chrome, Firefox, Safari, Edge: 100% support
- Support dates back to earliest modern browser versions
- No IE concerns (deprecated and unsupported)
Ruby display values:
- Well-implemented in browsers serving East Asian markets
- Modern browsers have comprehensive support
- Fallback behavior is graceful
Fallback Strategies
Provide sensible fallbacks for older browsers:
/* Fallback for older browsers */
.form-row {
display: block;
margin-bottom: 1rem;
}
.form-label,
.form-input {
display: block;
width: 100%;
}
/* Modern browsers override with table display */
@supports (display: table) {
.form-row {
display: table-row;
}
.form-label,
.form-input {
display: table-cell;
}
}
Robust browser support makes these techniques reliable for production applications built by our web development team.
Performance Considerations
When to Use Display Internal
Use display internal values when:
- Rendering tabular data
- Creating form layouts requiring equal-height columns
- Implementing East Asian typography (ruby)
- Building data-rich interfaces like pricing tables
Consider alternatives when:
- Building overall page layout (use CSS Grid)
- Creating flexible component layouts (use Flexbox)
- Needing complex responsive behavior
Render Performance
The browser's table layout algorithm is highly optimized:
- Calculates column widths once
- Maintains widths until content changes
- Avoids layout thrashing during resize
- Often outperforms equivalent Flexbox/Grid layouts
For data-heavy interfaces like dashboards and reports, table display values can provide more stable performance characteristics than fluid layouts that recalculate on each resize event. This performance efficiency is crucial for high-traffic websites where milliseconds impact user experience and search rankings.
Combining with Modern Layout Techniques
Display internal values work well with Flexbox and Grid for hybrid layouts:
/* Hybrid layout approach */
.page-grid {
display: grid;
grid-template-columns: 250px 1fr;
min-height: 100vh;
}
.data-table {
display: table;
width: 100%;
border-collapse: collapse;
}
.data-row {
display: table-row;
}
.data-cell {
display: table-cell;
padding: 0.75rem;
border-bottom: 1px solid #dee2e6;
}
Best Practices and Common Patterns
Accessibility Considerations
When using display internal values with non-semantic elements, ensure accessibility:
/* ARIA roles for accessible table display */
.data-table {
display: table;
role: table;
}
.data-row {
display: table-row;
role: row;
}
.data-cell {
display: table-cell;
role: cell;
}
Key Takeaways
- Display internal values only have meaning within specific layout contexts (table, ruby)
- Table internal values (8 values) control table structure and cell behavior
- Ruby internal values (4 values) enable East Asian typography features
- Excellent browser support across all modern browsers
- Use for intended purposes: tabular data, forms, East Asian text
- Consider alternatives: Flexbox and Grid for general layout
Quick Reference
| Value | Layout Model | HTML Equivalent |
|---|---|---|
table-row-group | Table | <tbody> |
table-header-group | Table | <thead> |
table-footer-group | Table | <tfoot> |
table-row | Table | <tr> |
table-cell | Table | <td>, <th> |
table-column-group | Table | <colgroup> |
table-column | Table | <col> |
table-caption | Table | <caption> |
ruby-base | Ruby | <rb> |
ruby-text | Ruby | <rt> |
ruby-base-container | Ruby | Auto-generated |
ruby-text-container | Ruby | <rtc> |
Frequently Asked Questions
What is the difference between display: table and <table> HTML?
display: table creates a table formatting context using any element, while <table> is the semantic HTML element. Both use the same layout algorithm. Use display: table for layout flexibility without semantic commitment, or <table> for proper semantic markup.
Can I use display: table for page layout instead of CSS Grid?
While possible, it's not recommended for main page layout. CSS Grid provides better control over alignment, gaps, and responsive behavior. Use display: table for its intended purpose: tabular data and form layouts.
What happens if I use table-cell without a table parent?
Browsers apply display fixup rules to create anonymous table boxes. The browser wraps the cell in an anonymous table-row and table wrapper box. This makes display: table-cell relatively robust but should only be used intentionally within table contexts.
Do I need ruby display values for English websites?
No. Ruby display values are specifically for East Asian typography (Japanese, Chinese, Korean) where small annotations provide pronunciation guides. English websites don't require these values.
How do I create equal-height columns with display: table?
Set the container to display: table with width: 100%. Set children to display: table-cell. The table layout algorithm automatically makes all cells in a row equal height. Use border-collapse and border-spacing for styling control.