S or /

SourceClass TableBody

from egui import TableBody
class TableBody:

The body of a table.

Is created by calling body on a Table (after adding a header row) or TableBuilder (without a header row).

Methods§

Sourcedef heterogeneous_rows(self, /, heights: Any) -> Any§

Add rows with varying heights.

This takes a very slight performance hit compared to TableBody.rows due to the need to iterate over all row heights in order to calculate the virtual table height above and below the visible region, but it is many orders of magnitude more performant than adding individual heterogeneously-sized rows using TableBody.row at the cost of the additional complexity that comes with pre-calculating row heights and representing them as an iterator.

Example

Sourcedef max_rect(self, /) -> Rect§

Where in screen-space is the table body?

Sourcedef row(self, /, height: float) -> Any§

Add a single row with the given height.

⚠️ It is much more performant to use egui.TableBody.rows or egui.TableBody.heterogeneous_rows, as those functions will only render the visible rows.

Sourcedef rows(self, /, row_height: float, total_rows: int) -> Any§

Add many rows with same height.

Is a lot more performant than adding each individual row as non visible rows must not be rendered.

If you need many rows with different heights, use egui.TableBody.heterogeneous_rows instead.

Example

Sourcedef widths(self, /) -> list[float]§

Return a vector containing all column widths for this table body.

This is primarily meant for use with TableBody.heterogeneous_rows in cases where row heights are expected to according to the width of one or more cells -- for example, if text is wrapped rather than clipped within the cell.