Skip to content
Latestv1.0.63

Table - Grouped Header ​

When the data structure is complex, grouped headers can be used to display hierarchical relationships.

Basic Grouped Header ​

Simply add the children property in column configuration to easily implement grouped headers. The underlying layer automatically calculates rowspan and colspan based on data nesting depth.

Basic Grouped Header

Multi-Level Header (3+) ​

children supports unlimited nesting levels for extremely complex header structures. The table uses a high-performance recursive restructuring algorithm internally, ensuring smooth rendering performance even with deep nesting.

Multi-Level Nested Header

Grouped Header with Row/Column Merge ​

Grouped headers work perfectly with span-method. Often used to display categorized data with hierarchical relationships, making reports more readable through header grouping and cell merging.

Grouped Header with Row Merge

Collapsible Grouped Header ​

Using Vue reactive features and computed properties, you can implement dynamically expandable/collapsible grouped headers. This is very useful for reports that need to display many detailed metrics while keeping the interface clean.

Dynamic Expand/Collapse Header

API ​

The following properties are supported in the TableColumn interface:

PropertyDescriptionTypeDefault
keyColumn unique identifierstring—
propColumn field namestring—
labelColumn titlestring—
widthColumn widthnumber | string—
minWidthMin column widthnumber | string—
maxWidthMax column widthnumber | string—
alignContent alignment'left' | 'center' | 'right''left'
headerAlignHeader alignment'left' | 'center' | 'right'—
fixedFixed column'left' | 'right' | true—
sortableWhether sortableboolean | 'custom'false
resizableWhether column width is resizablebooleantrue
showOverflowTooltipWhether to show overflow tooltipboolean | objectfalse
classNameColumn class namestring—
headerClassNameHeader class namestring—
styleColumn styleCSSProperties—
headerStyleHeader styleCSSProperties—
visibleWhether visiblebooleantrue
childrenSub-column configuration (for grouped headers)TableColumn[]—
typeColumn type'selection' | 'index' | 'expand' | 'radio'—
renderCustom cell render(params) => VNode—
headerRenderCustom header render(params) => VNode—
indexMethodCustom method for index column(index: number) => number | string—
selectableCheckbox selectable function(row, index) => boolean—
sortBySpecify sort fieldstring | ((row) => unknown)—
sortMethodCustom sort method(a, b, order) => number—
ellipsisEllipsis configurationboolean | EllipsisConfigfalse
formatterCell formatter method(row, column, cellValue, index) => string | VNode—

Notes:

  1. Columns with children set will have their prop property ignored, as the column only serves as a grouping container.
  2. The fixed property is recommended to be set on the outermost layer (e.g., "Date" column in the example) or the bottom-most data columns; do not repeat the fixed property for middle grouping columns.

Released under the MIT License.