|
|
HTML <td> tag
Syntax
<td> - </td>
Definition and Usage
The TD element defines a cell in a table.
Optional Attributes
| Attribute |
Value |
Description |
| abbr |
abbr_text |
Specifies an abbreviated version of the content in a cell |
| align |
left
right
center
justify
char |
Specifies the horizontal alignment of cell content |
| axis |
category_names |
Defines a name for a cell |
| bgcolor |
rgb(x,x,x)
#xxxxxx
colorname |
Specifies the background color of the table cell.
Deprecated. Use styles instead. |
| char |
character |
Specifies which character to align text on.
Note: Only used if align="char"!
|
| charoff |
pixels
% |
Specifies the alignment offset to the first character to
align on.
Note: Only used if align="char"!
|
| colspan |
number |
Indicates the number of columns this cell should span |
| headers |
header_cells'_id |
A space-separated list of cell IDs that supply header
information for the cell. This attribute allows text-only browsers to
render the header information for a given cell |
| height |
pixels |
Specifies the height of the table cell. Deprecated. Use
styles instead. |
| nowrap |
nowrap |
Whether to disable or enable automatic text wrapping in
this cell. Deprecated. Use styles instead. |
| rowspan |
number |
Indicates the number of rows this cell should span |
| scope |
col
colgroup
row
rowgroup |
Specifies if this cell provides header information for
the rest of the row that contains it (row), or for the rest of the
column (col), or for the rest of the row group that contains it
(rowgroup), or for the rest of the column group that contains it |
| valign |
top
middle
bottom
baseline |
Specifies the vertical alignment of cell content |
| width |
pixels
% |
Specifies the width of the table cell. Deprecated. Use
styles instead. |
Standard Attributes
| id, class, title, style, dir, lang, xml:lang |
For a full description, go to Standard
Attributes.
Event Attributes
| onclick, ondblclick, onmousedown, onmouseup, onmouseover,
onmousemove, onmouseout, onkeypress, onkeydown, onkeyup |
For a full description, go to Event Attributes.
Example
| Source |
Output |
<table border = "4">
<tr>
<td>Cell 1</td>
<td>Cell 3</td>
</tr>
<tr>
<td>Cell 2</td>
<td>Cell 4</td>
</tr>
</table> |
| Cell 1 |
Cell 3 |
| Cell 2 |
Cell 4 |
|
|
|