HTML | <colgroup> valign Attribute
The HTML <colgroup> valign Attribute is used to specify the vertical alignment of text content in a colgroup Element.
Syntax:
<colgroup valign="top | middle | bottom | baseline">
Attribute Values
- top: It sets the content to top-align.
- middle: It sets the content to middle-align.
- bottom: It sets the content to bottom-align.
- baseline: It sets the content to baseline. The baseline is the line where most of the characters sit.
Example:
<!DOCTYPE html> <html> <head> <title> HTML ColumnGroup valign Attribute </title> <style> #myColGroup { background: green; } table { color: white; margin-left: 180px; background: yellow; } #Geek_p { color: green; font-size: 30px; } td { padding: 10px; } h1, h2 { text-align: center; } </style> </head> <body> <h1 style="color:green;"> GeeksForGeeks </h1> <h2> HTML ColumnGroup valign Attribute </h2> <table> <colgroup id="myColGroup" span="3" align="char" char="." charoff="3" valign="top"> </colgroup> <tr> <th>S.No</th> <th>Title</th> <th>Geek_id</th> </tr> <tr> <td>Geek_1</td> <td>GeekForGeeks</td> <th>Geek_id_1</th> </tr> <tr> <td>Geek_2</td> <td>GeeksForGeeks</td> <th>Geek_id_2</th> </tr> </table> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers: The browsers supported by HTML <colgroup> valign attribute are listed below:
- Internet Explorer
Recommended Posts:
- HTML | <th> valign Attribute
- HTML | <tr> valign Attribute
- HTML | <td> valign Attribute
- HTML | <tfoot> valign Attribute
- HTML | <thead> valign Attribute
- HTML | <tbody> valign Attribute
- HTML | value Attribute
- HTML | <bdo> dir Attribute
- HTML | alt attribute
- HTML | name Attribute
- HTML | max attribute
- HTML | <img> src Attribute
- HTML | <li> value Attribute
- HTML | <a> rel Attribute
- HTML | low Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : shubham_singh



