Colspan examples
Use [c2], [c3], etc. to make cells span multiple columns. Use _ as a placeholder in following columns.
Simple colspan
| 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 |
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.
| Feature | Basic Plan | Enterprise Plan | |||
|---|---|---|---|---|---|
| Mobile | Desktop | Mobile | Desktop | API | |
| Storage | 10 GB | 50 GB | Unlimited | Unlimited | Unlimited |
| Users | 1 | 5 | Unlimited | Unlimited | Unlimited |
| Support | Phone | Phone | Dedicated | ||
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>
Footer with colspan
| Item | Quantity | Price | Total |
|---|---|---|---|
| Widget A | 10 | $5.00 | $50.00 |
| Widget B | 5 | $10.00 | $50.00 |
| Widget C | 3 | $15.00 | $45.00 |
| Grand Total | $145.00 | ||
MDX source
<ListTable headerRows={1} footerRows={1} caption="Invoice items">
...
- - [c3] Grand Total
- _
- _
- $145.00
</ListTable>