<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)
text. Default value: none. Border style for the bottom edge of the cell.
colNumtext. Column number where this cell is placed (1-based).
integer. Default value: 1. Number of columns this cell spans.
text. Default value: left. Horizontal alignment for the cell's content (left, center, or right).
text. Initial text content of the cell.
text. Default value: none. Border style for the right edge 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.bottomtext. 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.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 (left, center, or right).
$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.righttext. Border style for the right edge 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>. The default horizontal alignment is left.
Attribute Example: bottom
The bottom attribute specifies a bounding line at the bottom of the <cell>.
Attribute Example: right
The right attribute specifies a bounding line at the right edge of the <cell>.
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>.