When using s-table inside s-page (which uses a grid layout with main content + aside), the table expands vertically to fill all remaining space in the parent container instead of sizing to its content.
Expected behavior
s-table should size to its content height, matching the behavior of other web components like s-section, s-box, s-text, etc.
Actual behavior
The table stretches vertically to fill all available parent height, leaving a large empty gap below the table rows.
Root cause
Inside s-table’s shadow DOM, the .scroll container has block-size: 100%:
.scroll {
block-size: 100%;
inline-size: 100%;
}
When s-table is placed inside a grid/flex parent (like s-page’s main content area), the host element stretches to fill available space, and block-size: 100% on .scroll resolves to that stretched height rather than the content height.
Minimal reproduction
<s-page heading="Dashboard">
<!-- Some content above -->
<s-section>
<s-text>This section sizes to content correctly.</s-text>
</s-section>
<!-- This table expands to fill all remaining height -->
<s-section padding="none">
<s-table>
<s-table-header-row>
<s-table-header>Name</s-table-header>
<s-table-header format="numeric">Value</s-table-header>
</s-table-header-row>
<s-table-body>
<s-table-row>
<s-table-cell>Location A</s-table-cell>
<s-table-cell>100</s-table-cell>
</s-table-row>
<s-table-row>
<s-table-cell>Location B</s-table-cell>
<s-table-cell>200</s-table-cell>
</s-table-row>
</s-table-body>
</s-table>
</s-section>
<s-box slot="aside">
<!-- Sidebar content taller than main content triggers the issue -->
<s-section heading="Sidebar">
<s-text>Tall sidebar content here...</s-text>
</s-section>
</s-box>
</s-page>
Workarounds attempted (none worked)
- style=“max-block-size: max-content; overflow: clip” on s-table
- style=“block-size: fit-content” on s-table
- Wrapping in s-box or div with align-self: start
- Wrapping in div with height: fit-content; overflow: hidden
Since .scroll is in the shadow DOM, we can’t override it from outside.
Suggested fix
Change block-size: 100% to block-size: fit-content (or max-content) on the .scroll container inside s-table’s shadow DOM.
