Custom tables
If you need more custom behavior than either EuiBasicTable or EuiInMemoryTable allow, you can opt to completely construct your own table from EUI's low-level table building block components, like EuiTableHeaderΒ and EuiTableRowCell.
There are several important caveats to keep in mind while doing so:
Selection and filtering
Custom table implementations must completely handle their own selection and filtering.
Mobile headers
You must supply a mobileOptions.header prop equivalent to the column header on each EuiTableRowCell so that the mobile version will use that to populate the per cell headers.
Also, in order to add mobile support for selection and filtering toolbars, you will need to implement the EuiTableHeaderMobile component as a wrapper around these and use EuiTableSortMobileΒ and EuiTableSortMobileItem components to supply mobile sorting. See demo below.
Cell text behavior
Set individual props like the truncateText prop to cells to enforce a single-line behavior and truncate their contents, or set the textOnly prop to false if you need the contents to be a direct descendent of the cell.
Below is one of many ways you might set up a custom table that account for all the above notes:
Sticky headers Beta
The stickyHeader prop keeps the table header
fixed at the top of the viewport as users scroll through long tables.
This enhances usability by maintaining column context during vertical scrolling
and unifies the scrolling experience between EuiTable components and EuiDataGrid.
This feature should be used in places where it's possible for the table to grow longer than the viewport.
Sticky horizontal scrollbar Beta
When a table is taller than the viewport, the horizontal scrollbar at the bottom becomes hard to reach.
Enable stickyScrollbar to display a scrollbar that sticks to the bottom
of the viewport when needed.
Props
EuiTable
Prop | Description and type | Default value |
|---|---|---|
Prop compressed# | Description and type Type: boolean | Default value |
Prop responsiveBreakpoint# | Description and type Named breakpoint. Below this size, the table will collapse Pass string | boolean | Default value m |
Prop tableLayout# | Description and type Sets the table-layout CSS property "fixed" | "auto" |