ShakibDShy

Header Groups Example

Learn how to group table headers in React Table Grid

This example demonstrates how to group related columns under a common header. Grouping headers can help organize data and improve readability by visually categorizing columns.

Overview

In this example, you will learn how to:

  • Define columns with a group property
  • Organize columns into header groups (e.g., grouping personal information separately from contact information)
  • Enable header groups using the headerGroups prop

Example

Header Groups

Personal Information
Contact Information
Name
Age
Email
Adrian Brown
38
adrian.b@company.com
Alexander Davis
37
alex.d@company.com
Amelia Moore
35
amelia.m@company.com
Andrew Wilson
44
andrew.w@company.com
Aria Davis
31
aria.d@company.com
Aurora White
32
aurora.w@company.com
Ava Martinez
33
ava.m@company.com
Benjamin Taylor
39
ben.t@company.com
Charlotte Wilson
31
charlotte.w@company.com
Christopher Moore
38
chris.m@company.com
Daniel White
35
daniel.w@company.com
David Lee
37
david.l@company.com
Elena Anderson
34
elena.a@company.com
Elijah Thompson
40
elijah.t@company.com
Emily Davis
29
emily.d@company.com
Emma Rodriguez
30
emma.r@company.com
Ethan Anderson
40
ethan.a@company.com
Felix Wilson
41
felix.w@company.com
Gabriel Martinez
37
gabriel.m@company.com
Hazel Garcia
33
hazel.g@company.com
Henry Garcia
43
henry.g@company.com
Isabella Thompson
31
isabella.t@company.com
Jack Thompson
41
jack.t@company.com
James Taylor
39
james.t@company.com
Jane Smith
34
jane.smith@company.com
Jennifer Martinez
36
jennifer.m@company.com
John Doe
28
john.doe@company.com
Leo Wilson
42
leo.w@company.com
Lily Moore
33
lily.m@company.com
Lisa Anderson
33
lisa.a@company.com
Lucas Brown
37
lucas.b@company.com
Luna Rodriguez
30
luna.r@company.com
Matthew Brown
36
matthew.b@company.com
Max Lee
36
max.l@company.com
Maya Rodriguez
34
maya.r@company.com
Mia Johnson
34
mia.j@company.com
Michael Wilson
45
michael.w@company.com
Noah Clark
39
noah.c@company.com
Olivia Garcia
29
olivia.g@company.com
Owen Martinez
38
owen.m@company.com
Robert Johnson
41
robert.j@company.com
Ruby Anderson
31
ruby.a@company.com
Sarah Brown
31
sarah.b@company.com
Scarlett White
33
scarlett.w@company.com
Sebastian Clark
36
sebastian.c@company.com
Sophia Lee
32
sophia.l@company.com
Stella Davis
35
stella.d@company.com
Victoria Lee
32
victoria.l@company.com
William Clark
42
william.c@company.com
Zoe Garcia
35
zoe.g@company.com

Key Concepts

  • Grouping: Use the group property to categorize columns under a common header.
  • Activation: Enable header grouping by setting headerGroups to true in the TableGrid component.

Customization Tips

  • Adjust the styling of group headers via the styleConfig prop for better visual distinction.
  • Group only related columns to maintain clarity.

Best Practices

  1. Organization: Use header groups to logically separate different types of data (e.g., personal vs. contact info).
  2. Clarity: Avoid overly complex groupings that can confuse users.

Next Steps

Last updated on

On this page