You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Adjust the number of rows to the container height
185
+
## Auto Row Count
186
186
187
-
By adding the `visibleRowCountMode` prop and setting it to `AnalyticalTableVisibleRowCountMode.Auto` the table automatically fills the surrounding container with rows and when setting it to `AnalyticalTableVisibleRowCountMode.AutoWithEmptyRows`, empty rows fill the container as well, if not enough visible rows are available.
187
+
Set `visibleRowCountMode` to `AnalyticalTableVisibleRowCountMode.Auto` or `AutoWithEmptyRows` to let the table automatically fill its container with rows.
188
+
189
+
**Prerequisites:**
190
+
191
+
- The table **must** be placed inside a container with a **defined height** (e.g. `height: 500px`, `flex: 1`, or a CSS Grid row). Without a constrained parent, the table cannot determine how many rows to render.
192
+
-`AutoWithEmptyRows` fills remaining space with empty rows when there aren't enough data rows to fill the container.
193
+
-`Auto` may lead to inconsistent table heights depending on the container — prefer `AutoWithEmptyRows` for a stable layout.
@@ -233,7 +239,7 @@ In the example below you can have a look at this behavior:
233
239
-`600`: The content of the "Age" column is moved to the first column (`responsiveMinWidth: 601`) and receives a custom header.
234
240
-`400`: The content of the "Friend Name" column is moved to the first column and the "Friend Age" column is hidden (`responsiveMinWidth: 401`). The "Friend Name" column also receives a custom header.
To display show the navigation column you need to set `withNavigationHighlight` to `true` and to mark a row as "navigated" the `markNavigatedRow` prop is required.
334
-
With the `markNavigatedRow` callback it is possible to define when and how many navigation indicators should be shown.
335
-
336
-
Click on any of the rows in the example below to display the "navigated" indicator in the navigation-column.
It is possible to define your own filter function and filter component on each column. For this you need to customize the column option `filter` or add a custom filter type to the `reactTableOptions.filterTypes` object (for a custom filter function) and the column option `Filter` (for a custom filter component).
370
-
371
-
Here you can find an example using a `MultiComboBox` with multiple values as filter.
// you can also define your function here, then you can just pass the key as string to the `filter` column option
429
-
// reactTableOptions={{
430
-
// filterTypes: {
431
-
// multiValueFilter: filterFn
432
-
// }
433
-
// }}
434
-
/>
435
-
</ThemeProvider>
436
-
);
437
-
};
438
-
```
439
-
440
-
</details>
441
-
442
337
## Table Without Data
443
338
444
339
Use the `NoDataComponent` prop to customize the empty state. By default, a simple text message is shown. You can pass a custom component (e.g. an `IllustratedMessage`) to display a richer empty state for different scenarios like "no data" vs. "no filter results". The component receives an `accessibleRole` prop that should be forwarded for accessibility.
445
340
341
+
**Note:** When using an `IllustratedMessage` as `NoDataComponent`, the table must have sufficient height for the illustration to render properly. With `visibleRowCountMode` set to `Auto` or `AutoWithEmptyRows`, the table container needs a minimum height of approximately `300px`. With the default `Fixed` mode, ensure `visibleRows` provides enough vertical space (typically 5+ rows).
342
+
446
343
<Canvasof={ComponentStories.NoData} />
447
344
448
345
### Code
@@ -506,90 +403,6 @@ function NoDataTable(props) {
506
403
507
404
</details>
508
405
509
-
## AnalyticalTable with subcomponents
510
-
511
-
Adding custom subcomponents below table rows can be achieved by setting the `renderRowSubComponent` prop.
512
-
The prop expects a function with an optional parameter containing the `row` instance, there you can control which row should display subcomponents. Use the `subComponentsBehavior` control below to switch between `"Expandable"` (default, click to expand), `"Visible"` (always shown), `"IncludeHeight"` (always shown, height included in body calculation), and `"IncludeHeightExpandable"` (expandable, body height adjusts on toggle).
513
-
514
-
**Notes:**
515
-
516
-
- When `renderRowSubComponent` is set, `grouping` is disabled.
517
-
- When rendering active elements inside the subcomponent, make sure to add the `data-subcomponent-active-element` attribute, otherwise focus behavior won't be consistent.
518
-
- When `AnalyticalTableSubComponentsBehavior.IncludeHeight` or `AnalyticalTableSubComponentsBehavior.IncludeHeightExpandable` is used, `AnalyticalTableVisibleRowCountMode.Interactive` is not supported.
A comprehensive example combining many AnalyticalTable features: sorting, filtering, grouping, custom cells, row and navigation highlighting, infinite scrolling, column reordering, vertical alignment, `scaleWidthModeOptions` for custom renderers, `retainColumnWidth`, `sortDescFirst`, and more.
0 commit comments