Skip to main content

TableTruncateController

Purpose

Allow the collapsing of long tables, down to a specified number of rows, and a button to expand the table to full-height.

Actions

ActionPurpose
expandShow the full set of rows in the table
truncateHide any rows that are greater than the specified limit number

Targets

TargetPurposeDefault
showMoreThe <tr> element that is shown when the table is truncated, and should contain an element or button that expands the table.-

Classes

ClassPurposeDefault
---

Values

ValueTypeDescriptionDefault
limitNumberThe number of rows to show when the table is collapsed20

Events

EventWhenDispatched onevent.detail
----

Side Effects

  • Sets "display: none" on all hidden table rows. Removes "display" style when rows are shown.
  • Installs a mutation observer to watch the table body for changes, if rows are added while the table is truncated, it will recalculate the rows that should be shown/hidden.

How to Use