<table>

A container element for a `<tabular>`

<table> is a Sectional component that serves as a container element for data rendered in a <tabular> format. Much of the DoenetML for customizing the appearance of a table occurs in its <tabular>, <row>, or <cell> children.

Attributes and Properties

Attributes for <table>

Other (2)

boolean. Default value: true. Whether to display an auto-generated table number.

boolean. Default value: false. Whether to omit the auto-generated table name from the title.

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. Default value: 1. The style number used to select this component's visual styling from the available style definitions.

Properties for <table name="t">

Other (7)
$t.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$t.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$t.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$t.hidden

boolean. Whether this component is hidden from the rendered output.

$t.tableEnumeration

text. Auto-generated number for this table.

$t.tableName

text. The full display name of the table (e.g., 'Table 2').

$t.title

text. The table's title.

Common to all components (4)
$t.doenetML

text. The DoenetML source code that produced this component.

$t.hide

boolean. Whether to hide this component from the rendered output.

$t.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$t.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: <table> without attributes

In the sample code above, the <table> component is used without any additional attributes specified.


Example: <table> with dividing lines

In order to render dividing lines inside a <table>, the relevant border attributes, top, bottom, left, and right are specified in either the <tabular>, or <row> children.


Example: <table> with varying widths

Tables with varying widths are constructed by adjusting the colSpan attribute within the <cell> components.


Example: <table> with thick line below header only

To render a thicker line below the header row, use the bottom attribute with the medium or major specification within the <row> component.

Attribute Examples

Attribute Example: number

In the sample code above, the <table> component is used in combination with the number attribute set to false, which removes the default numbering for a table.


Attribute Example: suppressTableNameInTitle

In the sample code above, the <table> component is used in combination with the suppressTableNameInTitle attribute set to true, which results in a table with only the user-defined title rendered.