<tabular>
<tabular> is a Sectional
component that contains the data and style specifications for a <table>. Nested
inside a <tabular> component are the <row> and <cell>
components.
Attributes and Properties
Attributes for <tabular>
Other (8)
keyword. Border style for the bottom edge of the layout.
| Value | Description |
|---|---|
none (default) | Do not render a border. |
minor | Render a thin border line. |
medium | Render a medium-weight border line. |
major | Render a thick border line. |
keyword. Border style for the trailing edge of the layout: its right edge in a left-to-right document, its left edge in a right-to-left one.
| Value | Description |
|---|---|
none (default) | Do not render a border. |
minor | Render a thin border line. |
medium | Render a medium-weight border line. |
major | Render a thick border line. |
keyword. Default horizontal alignment for cells.
| Value | Description |
|---|---|
start (default) | Align cell content to the leading edge: the left in a left-to-right document, the right in a right-to-left one. |
center | Center cell content horizontally. |
end | Align cell content to the trailing edge: the right in a left-to-right document, the left in a right-to-left one. |
justify | Justify cell content across the full cell width. |
componentSize. Display height of the tabular layout.
keyword. Border style for the leading edge of the layout: its left edge in a left-to-right document, its right edge in a right-to-left one.
| Value | Description |
|---|---|
none (default) | Do not render a border. |
minor | Render a thin border line. |
medium | Render a medium-weight border line. |
major | Render a thick border line. |
keyword. Border style for the top edge of the layout.
| Value | Description |
|---|---|
none (default) | Do not render a border. |
minor | Render a thin border line. |
medium | Render a medium-weight border line. |
major | Render a thick border line. |
keyword. Default vertical alignment for cells.
| Value | Description |
|---|---|
top | Align cell content to the top. |
middle (default) | Center cell content vertically. |
bottom | Align cell content to the bottom. |
componentSize. Default value: {"size":100,"isAbsolute":false}. Display width of the tabular layout.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <tabular name="t">
Other (12)
$t.bottomBordertext. Border style for the bottom edge of the layout.
$t.disabledboolean. Whether this component is disabled and cannot be interacted with.
$t.endBordertext. Border style for the trailing edge of the layout: its right edge in a left-to-right document, its left edge in a right-to-left one.
$t.fixedboolean. Whether this component's value is fixed and cannot be modified.
$t.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$t.haligntext. Default horizontal alignment for cells.
$t.heightcomponentSize. Display height of the tabular layout.
$t.startBordertext. Border style for the leading edge of the layout: its left edge in a left-to-right document, its right edge in a right-to-left one.
$t.topBordertext. Border style for the top edge of the layout.
$t.valigntext. Default vertical alignment for cells.
$t.widthcomponentSize. Display width of the tabular layout.
Common to all components (4)
$t.doenetMLtext. The DoenetML source code that produced this component.
$t.hideboolean. Whether to hide this component from the rendered output.
$t.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$t.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Default <tabular> without attributes
A <tabular> can be used alone, without attributes, simply to organize content in a regular structure.
Example: Specifying borders and dividing lines
Borders and dividing lines within a <table> can be specified within the <tabular> component using the attributes: topBorder, bottomBorder, startBorder, and endBorder. startBorder and endBorder follow the writing direction: in a left-to-right document startBorder is the left edge and endBorder the right, and in a right-to-left document they swap. If subsequent <row> or <cell> components also have the same attribute specified, the attribute corresponding to the lowest hierarchical level takes precedence. All border/dividing line attributes accept either major, medium, minor, or none (default).
Example: Specifying vertical alignment with <tabular>
The height and vAlign attributes within a <tabular> can control the height and vertical alignment of individual rows for the entire table.
Example: Specifying horizontal alignment with <tabular>
The width and hAlign attributes within a <tabular> can control the width and horizontal alignment of individual rows for the entire table.
Attribute Examples
Attribute Example: width/height
The width and height attributes for the <tabular> component accept measurements for the extents of the <tabular>. Width is specified as a percentage of screen width, and height is specified in absolute measurements. Individual rows and cells are then scaled in proportion to these extents.
Attribute Example: hAlign
The hAlign attribute within a <tabular> controls the horizontal alignment of individual rows for the entire table. Valid values are start (default), center, end, and justify. start and end follow the writing direction: start is the left edge in a left-to-right document and the right edge in a right-to-left one.
Attribute Example: vAlign
The vAlign attribute within a <tabular> controls the vertical alignment of individual rows for the entire table. Valid values are top, middle (default) and bottom.
Attribute Example: topBorder/bottomBorder/startBorder/endBorder
Borders and dividing lines within a <table> can be specified within the <tabular> component using the attributes: topBorder, bottomBorder, startBorder, and endBorder. startBorder and endBorder follow the writing direction: in a left-to-right document startBorder is the left edge and endBorder the right, and in a right-to-left document they swap. If subsequent <row> or <cell> components also have the same attribute specified, the attribute corresponding to the lowest hierarchical level takes precedence. All border/dividing line attributes accept either major, medium, minor, or none (default).
Property Examples
Property Example: Attributes as properties
The above-listed attributes of the <tabular> component are also accessible as properties.