May 03, 2021 HTML5
HTML5 is used to represent cells in a table. Please refer to the following example:
A simple HTML table with two cells:
<table border="1">
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>
All major browsers support the hashtag.
The label defines the standard cells in the HTML table.
HTML tables have two cell types:
The text in the element is usually bold and centered.
The text in the element is usually normal left-aligned text.
Tip: If you need to span content across multiple rows or columns, use the colspan and rowspan properties!
Some properties in HTML 4.01 are no longer supported in HTML 5.
Property | Value | Describe |
---|---|---|
abbr | text | HTML5 is not supported. Specifies an abbreviated version of the content in the cell. |
align |
left
right center justify char |
HTML5 is not supported. Specifies the horizontal alignment of cell contents. |
axis | category_name | HTML5 is not supported. Classify cells. |
bgcolor |
rgb(x,x,x)
#xxxxxx colorname |
HTML5 is not supported. H TML 4.01 is obsolete. Specifies the background color of the cell. |
char | character | HTML5 is not supported. Specify which character to align the content against. |
charoff | number | HTML5 is not supported. Specifies the offset of aligned characters. |
colspan | number | Specifies the number of columns a cell can span. |
headers | header_id | Specifies one or more header cells associated with a cell. |
height |
pixels
% |
HTML5 is not supported.
HTML 4.01 is obsolete.
Set the height of the cell. |
nowrap | nowrap |
HTML5 is not supported.
HTML 4.01 is obsolete.
Specify whether the contents of the cell are folded. |
rowspan | number | Sets the number of rows a cell can span. |
scope |
col
colgroup row rowgroup |
HTML5 is not supported. Defines the method that associates the header cell with the data cell. |
valign |
top
middle bottom baseline |
HTML5 is not supported. Specifies how the contents of the cells are arranged vertically. |
width |
pixels
% |
HTML5 is not supported. H TML 4.01 is obsolete. Specifies the width of the cell. |
Labels support the global properties of HTML.
The tag supports the event properties of HTML.
The title in the table
This example shows how to display the table title.
Empty cell
This example shows how to use to work with cells without content.
Table with title
This example shows a table with a title.
The label in the table
This example shows how to display elements within other elements.
Table cells that span rows or columns
This example shows how to define table cells that span rows or columns.
HTML tutorial: HTML tables
HTML DOM Reference Manual: Td Objects