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.
Optional Attributes
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.
Optional Attributes
- colspan can be used to specify across how many columns the cell should spread. The default value is 1.
- rowspan can be used to specify across how many rows the cell should spread. The default value is 1.
- abbr can be used to specify an abbreviated version of the content of the cell.
- axis can 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.
- headers can be used to explicitly specify which header cells are associated to the cell. The value is a single or comma-separated list of table cell id values.
- scope can be used to explicitly specify that the cell contains header information for the rest of the row (value row), column (value col), row group (value rowgroup) or column group (value colgroup) that contains it.
- align can be used to horizontally align the content of the cell. The value can be left, center, right, justify or char.
- valign can be used to vertically align the content of the cell. The value can be top, middle, bottom or baseline.
- char can be used to specify a character with which cells will align, such as a decimal point. It is not supported by any major browser.
- charoff can 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.
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>
No comments:
Post a Comment