Table [tbl_table]
The [tbl_table] shortcode renders a responsive comparison table with striped rows and a scrollable container for wide screens. It is designed for feature comparison, pricing tables, and specification lists.
Usage
[tbl_table
headers="Feature,Free Plan,Pro Plan"
rows="Storage,1 GB,50 GB,
Users,1,Unlimited,
Support,Email only,Priority 24/7,
Custom domain,No,Yes"]
Parameters
| Parameter | Required | Description |
|---|---|---|
headers | Yes | Comma-separated list of column header labels. |
rows | Yes | Comma-separated cell values. Rows are divided automatically by the number of columns in headers. |
caption | No | Optional table caption displayed above the table. |
How rows work
The rows parameter is a flat, comma-separated list. The theme divides it into rows automatically based on the number of columns defined in headers. If you have 3 headers, every 3 values form one row.
For example, with headers="Name,Score" and rows="Alice,95,Bob,87,Carol,91", the output is:
| Name | Score |
|---|---|
| Alice | 95 |
| Bob | 87 |
| Carol | 91 |
Responsive behavior
On narrow screens, the table scrolls horizontally inside its container. The page layout is not affected. This ensures wide tables remain readable on mobile without breaking the layout.
Commas inside cell values will break the column alignment since commas are used as delimiters. Avoid using commas in cell content, or use an alternative separator by editing the shortcode output in the child theme.