English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
In HTML5 does not support the <colgroup> valign attribute. The valign attribute specifies the vertical alignment of the content within the column group.
An HTML table with columns of different vertical alignment styles:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML <colgroup> span Attribute Usage-Basic Tutorial(oldtoolbag.com)</title> <style>table, th, td { border: 1px solid black;}</style> </head> <body> <table style="height:200px"> <colgroup valign="top"> <colgroup valign="bottom"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Only Internet Explorer and Opera support the valign attribute. However, IE and Opera do not support the attribute value "baseline".
In HTML5 In HTML, the valign attribute of <colgroup> is not supported.
The valign attribute specifies the vertical alignment of the content within the column group.
<colgroup valign="top|middle|bottom|baseline">
Value | Description |
---|---|
top | Aligns content upward. |
middle | Aligns content to the center (default value). |
bottom | Aligns content downward. |
baseline | Aligns content to the baseline. The baseline is a fictional line. In a line of text, most letters are based on the baseline. The baseline value sets all table data in the line to share the same baseline. The effect of this value is often the same as the bottom value. However, if the text sizes are different, the baseline effect will be better. Please see the illustration below. |
Illustration of bottom vs. baseline when the text size is different:
valign="bottom"
valign="baseline"
HTML <colgroup> tag