Tables
======
The ``
`` element renders tabular data with titles, rows, and cells.
Tables support horizontal and vertical orientations, column/row weights,
and JSON model binding for data-driven content.
.. note::
Inside tables, ```` is not valid.
Use ```` for horizontal table headers and ```` for vertical table titles.
Basic Table (Horizontal)
------------------------
.. code-block:: xml
Name
Price
| Widget A |
$9.99 |
| Widget B |
$14.50 |
Basic Table (Vertical)
----------------------
.. code-block:: xml
Name
| Widget A |
Price
| $9.99 |
Attributes
----------
.. list-table::
:header-rows: 1
:widths: 20 15 65
* - Attribute
- Type
- Description
* - ``model``
- string
- Template variable containing JSON data (matrix or object array).
* - ``baseline_offset``
- float
- Vertical offset for text alignment within cells (default ``0.25``).
Header Title Attributes
^^^^^^^^^^^^^^^^^^^^^^^
Each ```` in horizontal tables and each ```` in vertical
tables supports:
.. list-table::
:header-rows: 1
:widths: 20 15 65
* - Attribute
- Type
- Description
* - ``alignment``
- string
- ``left`` | ``center`` | ``right`` | ``justified``.
* - ``style``
- string
- ``normal`` | ``bold`` | ``italic`` | ``bold_italic``.
* - ``color``
- color
- Title text color.
* - ``background_color``
- color
- Title cell background.
Row Attributes
^^^^^^^^^^^^^^
.. list-table::
:header-rows: 1
:widths: 20 15 65
* - Attribute
- Type
- Description
* - ``background_color``
- color
- Row background color.
Data-Driven Tables
------------------
Tables can bind to JSON data via a template variable:
.. code-block:: xml
The ``model`` attribute accepts:
- **String matrix**: ``[["A","$10"],["B","$20"]]``
- **Object array**: ``[{"name":"A","price":"$10"}]`` — column order matches
header order.
The header can also be bound with a template variable using ``model``
on ````.