Skip to main content

Colspan examples

Use [c2], [c3], etc. to make cells span multiple columns. Use _ as a placeholder in following columns.

Simple colspan

Sales by region
Q1 Sales
RegionProductsServices
North$50,000$30,000
South$45,000$25,000
East$60,000$35,000
West$55,000$40,000

MDX source

<ListTable headerRows={2} caption="Sales by region">
- - [c3] Q1 Sales
- _
- _
- - Region
- Products
- Services
- - North
- $50,000
- $30,000
- - South
- $45,000
- $25,000
- - East
- $60,000
- $35,000
- - West
- $55,000
- $40,000
</ListTable>

Key points

  • [c3] makes "Q1 Sales" span three columns
  • In the row with the colspan, we need a placeholder _ after the colspan

Mixed colspan widths

You can have multiple colspans on the same row.

Product comparison
FeatureBasic PlanEnterprise Plan
MobileDesktopMobileDesktopAPI
Storage10 GB50 GBUnlimitedUnlimitedUnlimited
Users15UnlimitedUnlimitedUnlimited
SupportEmailEmailPhonePhoneDedicated

MDX source

<ListTable headerRows={2} caption="Product comparison">
- - [r2] Feature
- [c2] Basic Plan
- _
- [c3] Enterprise Plan
- _
- _
- - _
- Mobile
- Desktop
- Mobile
- Desktop
- API
- - Storage
- 10 GB
- 50 GB
- Unlimited
- Unlimited
- Unlimited
- - Users
- 1
- 5
- Unlimited
- Unlimited
- Unlimited
- - Support
- Email
- Email
- Phone
- Phone
- Dedicated
</ListTable>
Invoice items
ItemQuantityPriceTotal
Widget A10$5.00$50.00
Widget B5$10.00$50.00
Widget C3$15.00$45.00
Grand Total$145.00

MDX source

<ListTable headerRows={1} footerRows={1} caption="Invoice items">
...
- - [c3] Grand Total
- _
- _
- $145.00
</ListTable>