May 03, 2021 HTML5
2. Label definition and instructions for use
3. The difference between HTML 4.01 and HTML5
HTML5 labels are used to control the columns in the table, making it easier for you to style the columns in the table.
The labels set the background color for the three columns in the table:
<table border="1">
<colgroup>
<col span="2" style="background-color:red">
<col style="background-color:yellow">
</colgroup>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>
Try it out . . .
All major browsers support the hashtag.
The label specifies the column properties of each column within the element.
By using the label, you can apply styles to the entire column without having to repeatedly style each cell or row.
Most of the properties in HTML 4.01 are no longer supported in HTML5.
In HTML, the label does not end the label.
In XHTML, the label must be properly turned off.
Property | Value | Describe |
---|---|---|
align
(abandoned)
|
left
right center justify char |
HTML5 is not supported. Specifies the horizontal alignment of content related to the element. |
char
(abandoned)
|
character | HTML5 is not supported. Specify which character to align the content related to the element. |
Charoff
(abandoned)
|
number | HTML5 is not supported. Specifies the offset of the first aligned character. |
span | number | Specifies the number of columns that an element should span. |
valign
(abandoned)
|
top
middle bottom baseline |
HTML5 is not supported. Specifies the vertical alignment of content related to the element. |
width
(abandoned)
|
%
pixels relative_length |
HTML5 is not supported. Specifies the width of a <col> element |
Labels support the global properties of HTML.
The tag supports the event properties of HTML.