Home → References → HTML Tags →
HTML Tag: td
Table data cell. If the cell contains a header rather than data, th should be used instead. td must be used inside a tr element.
HTML Dog is hosted by Titan Internet
Required Attributes
- None.
Optional Attributes
colspancan be used to specify across how many columns the cell should spread. The default value is1.rowspancan be used to specify across how many rows the cell should spread. The default value is1.abbrcan be used to specify an abbreviated version of the content of the cell.axiscan be used to specify a category that forms a conceptual axis in n-dimensional space for hierarchical structuring. The value can be a single name or a comma-separated list of names.headerscan be used to explicitly specify which header cells are associated to the cell. The value is a single or comma-separated list of table cellidvalues.scopecan be used to explicitly specify that the cell contains header information for the rest of the row (valuerow), column (valuecol), row group (valuerowgroup) or column group (valuecolgroup) that contains it.aligncan be used to horizontally align the content of the cell. The value can beleft,center,right,justifyorchar.valigncan be used to vertically align the content of the cell. The value can betop,middle,bottomorbaseline.charcan be used to specify a character with which cells will align, such as a decimal point. It is not supported by any major browser.charoffcan be used to specify the number of pixels the alignment should be offset from the char character. It is not supported by any major browser.- Common attributes
Example
<table>
<tr>
<th>Question</th>
<th>Answer</th>
<th>Correct?</th>
</tr>
<tr>
<td>What is the capital of Burundi?</td>
<td>Bujumburra</td>
<td>Yes</td>
</tr>
<tr>
<td>What is the capital of France?</td>
<td>F</td>
<td>Erm... sort of</td>
</tr>
</table>

