The table Directive
.. table:: wraps an existing grid or simple table (given as the
directive's own content) with a title/caption and the presentation options
neither ASCII-art syntax has notation of its own for.
Wrapping a Grid Table
Fruit |
Colour |
|---|---|
Apple |
Red |
Lemon |
Yellow |
Wrapping a Simple Table
A |
not A |
|---|---|
False |
True |
True |
False |
Table with a Title
The directive's argument, if given, becomes the table's caption:
A |
not A |
|---|---|
False |
True |
True |
False |
:widths:
Sets relative column widths — auto and grid both let the renderer
decide, while an explicit list of integers (matching the wrapped table's own
column count) is normalized into percentages:
Key |
Description |
|---|---|
name |
A short, human-readable identifier. |
:width:
Sets the overall table width:
Fruit |
Colour |
:align:
Aligns the table on the page — left, center, or right:
Fruit |
Colour |
:class:
Adds extra CSS classes to the rendered <table>:
Fruit |
Colour |
:name: and Cross-Referencing
Gives the table a hyperlink target, referenceable via :ref:. As with any
other internal target in rinx today, the link resolves to this
document, not precisely to the table itself.
Fruit |
Colour |
See wrapped-fruit-table for the wrapped table above.
Domain Objects Nested Inside a Cell
A wrapped table's cells are ordinary grid/simple table cells, so they parse as full block-level RST exactly like an unwrapped one — a cell can nest a domain-object definition:
Attribute |
Meaning |
|---|---|
|
The circle's radius, in pixels. |
Circle.radius resolves correctly because the definition above was
fully parsed rather than swallowed as opaque directive body text.