Th
API reference › HTML › Table › Th
Renders the HTML <th> element for table header cells.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/th (BaseBlock for the base implementation.).
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributes protected | mixed[] | HTML attributes array used by the implementing class. Default: []. | UIAwesome\ |
$content protected | string | Content string assigned to the element. Default: ''. | UIAwesome\ |
Methods
Section titled “Methods”Method details
Section titled “Method details”abbr()
Section titled “abbr() ”public function abbr(string|UnitEnum|null $value): staticSets the abbr attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | Abbreviated header description, or null to remove the attribute. |
Returns
static: New instance with the updated abbr attribute.
colspan()
Section titled “colspan() ”public function colspan(int|string|null $value): staticSets the colspan attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int| | Number of columns a cell spans (‘1’ to ‘1000’), or null to remove the attribute. |
Returns
static: New instance with the updated colspan attribute.
Throws
InvalidArgumentException: if the provided value is not an integer-like value between ‘1’ and ‘1000’.
headers()
Section titled “headers() ”public function headers(string|UnitEnum|null $value): staticSets the headers attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | Space-separated list of header cell IDs, or null to remove the attribute. |
Returns
static: New instance with the updated headers attribute.
rowspan()
Section titled “rowspan() ”public function rowspan(int|string|null $value): staticSets the rowspan attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | int| | Number of rows a cell spans (‘0’ to ‘65534’), or null to remove the attribute. |
Returns
static: New instance with the updated rowspan attribute.
Throws
InvalidArgumentException: if the provided value is not an integer-like value between ‘0’ and ‘65534’.
scope()
Section titled “scope() ”public function scope(string|UnitEnum|null $value): staticSets the scope attribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | Scope of related cells (‘row’, ‘col’, ‘rowgroup’, ‘colgroup’), or null to remove the attribute. |
Returns
static: New instance with the updated scope attribute. Scope for predefined enum values.
Throws
InvalidArgumentException: if the provided value is not valid.
getTag()
Section titled “getTag() ”protected function getTag(): UIAwesome\Html\Interop\TableReturns the tag enumeration for the <th> element.