Skip to main content

Complex merged cells

Complex header structure

You can have multiple headers and merge cells across both columns and rows.

Sales performance matrix
Region2024 Sales Data
Q1Q2Q3
ProductsServicesProductsServicesProductsServices
North$50k$30k$55k$35k$60k$40k
South$45k$25k$50k$30k$55k$35k
East$60k$35k$65k$40k$70k$45k
West$55k$40k$60k$45k$65k$50k

MDX source

<ListTable headerRows={3} headerColumns={1} caption="Sales performance matrix" validation="strict">
- - [r3] Region
- [c6] 2024 Sales Data
- _
- _
- _
- _
- _
- - _
- [c2] Q1
- _
- [c2] Q2
- _
- [c2] Q3
- _
- - _
- Products
- Services
- Products
- Services
- Products
- Services
- - North
- $50k
- $30k
- $55k
- $35k
- $60k
- $40k
...
</ListTable>

Large merged cell

Combine rowspan and colspan with [r2c3] syntax for cells that span both dimensions.

Project status dashboard
PROJECT ALPHAStatusProgress
Active75%
PhaseTaskOwnerDue Date
DevelopmentBackend APIAlice2024-02-15
DevelopmentFrontend UIBob2024-02-20
TestingQA TestingCarol2024-02-25

MDX source

<ListTable headerRows={3} caption="Project status dashboard">
- - [r2c2] PROJECT ALPHA
- _
- Status
- Progress
- - _
- _
- Active
- 75%
...
</ListTable>

Mixed patterns

Complex scheduling table
DayMorningAfternoon
Room ARoom BRoom ARoom B
MondayMeetingWorkshopTrainingReview
PresentationPlanningDemo
TuesdayTeam BuildingConference
WednesdayReviewMeetingAll-Hands
ThursdayPlanningDemo

MDX source

<ListTable headerRows={2} caption="Complex scheduling table">
- - [r2] Day
- [c2] Morning
- _
- [c2] Afternoon
- _
- - _
- Room A
- Room B
- Room A
- Room B
- - [r2] Monday
- Meeting
- [r2] Workshop
- Training
- Review
- - _
- Presentation
- _
- Planning
- Demo
- - Tuesday
- [c2] Team Building
- _
- [c2] Conference
- _
- - Wednesday
- Review
- Meeting
- [r2c2] All-Hands
- _
- - Thursday
- Planning
- Demo
- _
- _
</ListTable>

Notice how placeholders (_) are used:

  • For cells occupied by rowspans from above
  • For cells occupied by colspans from the left

The component automatically handles the cell positioning