diff --git a/aspnetcore/blazor/components/quickgrid.md b/aspnetcore/blazor/components/quickgrid.md index bee919985700..bdf0348b5707 100644 --- a/aspnetcore/blazor/components/quickgrid.md +++ b/aspnetcore/blazor/components/quickgrid.md @@ -138,6 +138,33 @@ To provide a UI for pagination, add a [`Paginator` component](xref:Microsoft.Asp In the running app, page through the items using a rendered `Paginator` component. +QuickGrid renders additional empty rows to fill in the final page of data when used with a `Paginator` component. In .NET 9 or later, empty data cells (``) are added to the empty rows. The empty rows are intended to facilitate rendering the QuickGrid with stable row height and styling across all pages. You can apply styles to the rows using [CSS isolation](xref:blazor/components/css-isolation) by wrapping the `QuickGrid` component in a wrapper element, such as a `
`, and applying a row style with `::deep` [pseudo-elements](https://developer.mozilla.org/docs/Web/CSS/Pseudo-elements): + +```css +::deep tr { + height: 2em; +} +``` + +To hide the empty row data cells rendered by the QuickGrid, use CSS styling. In the following isolated CSS styles: + +* Row cells populated with data are displayed. +* Empty row data cells aren't displayed, which avoids empty row cell borders from rendering per Bootstrap styling. + +`{COMPONENT}.razor.css`: + +```css +::deep tr:has(> td:not(:empty)) > td { + display: table-cell; +} + +::deep td:empty { + display: none; +} +``` + +For more information on using `::deep` [pseudo-elements](https://developer.mozilla.org/docs/Web/CSS/Pseudo-elements) with CSS isolation, see . + ## Custom attributes and styles QuickGrid also supports passing custom attributes and style classes () to the rendered table element: