<cell>
<cell> is a Sectional
component. It is the smallest element of a <tabular> block of text or
data inside a <table>.
Attributes and Properties
Attributes for <cell>
Other (7)
keyword. Border style for the bottom edge of the cell.
| 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. |
colNumtext. Column number where this cell is placed (1-based).
integer. Default value: 1. Number of columns this cell spans.
keyword. Border style for the trailing edge of the cell: 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. Horizontal alignment for the cell's content.
| 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. |
text. Initial text content of the cell.
rowNumtext. Row number where this cell is placed (1-based).
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 <cell name="c">
Other (15)
$c.bottomBordertext. Border style for the bottom edge of the cell.
$c.colNumtext. Column number where this cell is placed (1-based).
$c.colSpaninteger. Number of columns this cell spans.
$c.disabledboolean. Whether this component is disabled and cannot be interacted with.
$c.endBordertext. Border style for the trailing edge of the cell: its right edge in a left-to-right document, its left edge in a right-to-left one.
$c.fixedboolean. Whether this component's value is fixed and cannot be modified.
$c.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$c.haligntext. Horizontal alignment of the cell's content (start, center, end, or justify).
$c.inHeaderboolean. Whether this cell is in a header row of the table.
$c.mathmath. The cell's content interpreted as a math expression.
$c.numbernumber. The cell's content interpreted as a number.
$c.prefilltext. Initial text content of the cell.
$c.rowNumtext. Row number where this cell is placed (1-based).
$c.texttext. The cell's content as a text string.
Common to all components (4)
$c.doenetMLtext. The DoenetML source code that produced this component.
$c.hideboolean. Whether to hide this component from the rendered output.
$c.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$c.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <cell> inside a <table>
Each <cell> component defines a single entry in the <table>.
Attribute Examples
Attribute Example: colSpan
The colSpan attribute allows a single <cell> to span across
multiple columns. This attribute can also be used across all rows to create
visually wider “columns” within a table.
Attribute Example: hAlign
The hAlign attribute governs the horizontal alignment of
content within the <cell>. 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: bottomBorder
The bottomBorder attribute specifies a bounding line at the bottom of the <cell>.
Attribute Example: endBorder
The endBorder attribute specifies a bounding line at the trailing edge of the
<cell>: its right edge in a left-to-right document, its left edge in a
right-to-left one.
Attribute Example: prefill
The prefill attribute provides another way to specify content within the cell.
Property Examples
Property Example: Attributes as properties
All of the attributes available to the <cell> component can also be accessed as properties.
Property Example: inHeader
The inHeader property returns the boolean value corresponding to
whether the <cell> occurs within a header <row>.
Property Example: text
The text property returns the text value stored within the <cell>.
Property Example: math
The math property returns the math value stored within the <cell>.
Property Example: number
The number property returns the numerical value stored within the <cell>.