The Wayback Machine - https://web.archive.org/web/20240905215644/https://www.geeksforgeeks.org/html-th-valign-attribute/
Open In App

HTML | <th> valign Attribute

Last Updated : 22 Feb, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The HTML <th> valign Attribute is used to specify the vertical alignment of text content in a header cell. It is not supported by HTML 5.

Syntax:

<th valign="top | middle | bottom | baseline">

Attribute Value:

  • top: It sets the table header content to top-align.
  • middle: It sets the table header content to middle-align.
  • bottom: It sets the table header content to bottom-align.
  • baseline: It sets the table header content to baseline. The baseline is the line where most of the characters sit. It is a default value.

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML th valign Attribute
    </title>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <h2>HTML th valign Attribute</h2>
  
    <table border="1" width="500">
        <tr style="height:100px;">
            <th valign="top">NAME</th>
            <th valign="center">AGE</th>
            <th valign="bottom">BRANCH</th>
        </tr>
  
        <tr>
            <td>BITTU</td>
            <td>22</td>
            <td>CSE</td>
        </tr>
  
        <tr>
            <td>RAKESH</td>
            <td>25</td>
            <td>EC</td>
        </tr>
    </table>
</body>
  
</html>


Output:

Supported Browsers: The browser supported by HTML <th> valign attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera


Similar Reads

HTML | &lt;tbody&gt; valign Attribute
The HTML &lt;tbody&gt; valign Attribute is used to specify the vertical alignment of table cell content. Syntax: &lt;tbody valign="top | middle | bottom | baseline"&gt; Attribute Value: 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 ba
1 min read
HTML | &lt;tr&gt; valign Attribute
The HTML &lt;tr&gt; valign Attribute is used to specify the vertical alignment of text content in a table row. It is not supported by HTML 5. Syntax: &lt;tr valign= "top | middle | bottom | baseline"&gt; 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.
1 min read
HTML | &lt;tfoot&gt; valign Attribute
The HTML &lt;tfoot&gt; valign Attribute is used to specify the vertical alignment of text content in a table footer cell. It is not supported by HTML 5. Syntax: &lt;tfoot valign="top | middle | bottom | baseline"&gt; Attribute Value: top: It sets the content to top-align. middle: It sets the content to middle-align. bottom: It sets the content to b
1 min read
HTML | &lt;colgroup&gt; valign Attribute
The HTML &lt;colgroup&gt; valign Attribute is used to specify the vertical alignment of text content in a colgroup Element. Syntax: &lt;colgroup valign="top | middle | bottom | baseline"&gt; 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
1 min read
HTML | &lt;thead&gt; valign Attribute
The HTML thead valign Attribute is used to specify the vertical alignment of content inside the thead Element. Syntax: &lt;thead valign="top | middle | bottom | baseline"&gt; 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 conten
1 min read
HTML | &lt;col&gt; valign Attribute
The HTML &lt;col&gt; valign attribute is used to specify the vertical alignment of the text content in a column element. Syntax: &lt;col valign="top | middle | bottom | baseline"&gt; 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 th
1 min read
HTML valign Attribute
The HTML valign attribute is used to specify the vertical alignment of the text in the element. This attribute supports many table-related elements such as &lt;tr&gt;,&lt;td&gt;,&lt;tbody&gt;,&lt;col&gt;, and &lt;tfoot&gt;.  Note: The valign attribute is not supported by HTML5. Syntax:&lt;element valign="top | middle | bottom | baseline"&gt;Attribu
1 min read
HTML &lt;td&gt; valign Attribute
The HTML &lt;td&gt; valign attribute specifies the vertical alignment of content within a table cell. It can accept values such as top, middle, bottom, or baseline to control the positioning of content. If not explicitly set, the content in a table cell is vertically aligned to the middle by default. Note: The &lt;td&gt; valign Attribute is not sup
2 min read
HTML DOM Table Row vAlign Property
The HTML DOM Table Row vAlign Property is used to set or return the value of the valign attribute of the &lt;tr&gt; element. The valign attribute is used to specify the vertical alignment of the text-content inside the Table Row. Note: This property is not supported by HTML5. Syntax It returns the Table Row vAlign Property. TableRowobject.vAlign; I
2 min read
HTML DOM Table Header vAlign Property
The HTML DOM TableHeader vAlign property is used to set or return the value of the vAlign attribute of the &lt;th&gt; element. The vAlign attribute is used to specify the vertical alignment of the text-content inside the Table Header. Note: This property is no longer supported in HTML5. Syntax: It returns the Table Header vAlign Property. TableHead
2 min read
HTML DOM TableData vAlign Property
The HTML DOM TableData vAlign property is used to set or return the value of the vAlign attribute of the &lt;td&gt; element. The vAlign attribute is used to specify the vertical alignment of the text content inside the Table Data cell. Note: This property is no longer supported in HTML5. Syntax: It returns the Table Data vAlign property.TableDataob
2 min read
HTML DOM TBody vAlign Property
The HTML DOM TBody vAlign property is used to set or return the value of the valign attribute of the &lt;tbody&gt; element. The valign attribute is used to specify the vertical alignment of the text-content inside the table body element. Note: This property is no longer supported in HTML5. Syntax: It returns the TBody vAlign property. TBodyobject.v
2 min read
HTML DOM TFoot vAlign Property
The HTML DOM TFoot vAlign property is used to set or return the value of the vAlign attribute of the &lt;tfoot&gt; element. The vAlign attribute is used to specify the vertical alignment of the text content inside the table footer element. Note: This property is no longer supported in HTML5. Syntax It returns the TFoot vAlign property. TFootobject.
2 min read
HTML DOM THead vAlign Property
HTML DOM THead vAlign Property is used to set or return the value of the valign attribute of the &lt;thead&gt; element. The valign attribute is used to specify the vertical alignment of the text content inside the table heading element. Note: This property is no longer supported in HTML5. Syntax: It returns the THead vAlign property. THeadobject.vA
2 min read
How href attribute is different from src attribute in HTML ?
In HTML5, the href and src attributes play distinct roles in defining paths or URLs, each associated with specific HTML elements. The href attribute, commonly found in an anchor (&lt;a&gt;) elements, points to the destination of hyperlinks, facilitating navigation. The src attribute, used with elements like &lt;img&gt; and &lt;script&gt;, specifies
1 min read
When to use the class attribute and the id attribute ?
The class attribute is used when multiple HTML elements share a common style or behaviour, allowing the application of a shared style to several elements. It promotes code reusability and is suitable for elements with similar characteristics. The id attribute is utilized when a unique identifier is needed for a specific HTML element. This identifie
1 min read
How to use the target attribute and the rel attribute in the &lt;a&gt; Tag ?
The target and rel attributes in the &lt;a&gt; (anchor) tag is used to control the behaviour of hyperlinks, specifying how the linked content should be opened and establishing relationships between the current and linked documents. Here's how to use these attributes: target Attribute:The target attribute determines where the linked content will be
2 min read
HTML | &lt;html&gt; xmlns Attribute
The HTML &lt;html&gt; xmlns Attribute is used to specify the xml namespace for a document. Important Note: This attribute is mainly required in XHTML, not valid in HTML 4.01, and optional in HTML 5. Syntax: &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; Attribute Values: https://www.geeksforgeeks.org/ It defines the namespace to use (for XHTML d
1 min read
HTML | scoped Attribute
The HTML scoped attribute is a boolean attribute that is used to specify that the styles only apply to this element's parent element and that element's child elements (not the entire document).Note : It is a deprecated attribute and it is not supported by HTML5. Supported tag: style Example: C/C++ Code &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head
1 min read
HTML | &lt;col&gt; align Attribute
The HTML &lt;col&gt; align Attribute is used to set the horizontal alignment of text content inside the col element. It is not supported by HTML 5. Syntax: &lt;col align="left | right | center | justify | char"&gt; Attribute Values: left: It sets the text left-align. right: It sets the text right-align. center: It sets the text center-align. justif
1 min read
HTML | poster Attribute
The HTML poster Attribute is used to display the image while video downloading or when the user clicks the play button. If this image not set then it will take the first frame of video as a poster image.Applicable: It is mainly used in &lt;video&gt; element. Syntax: &lt;video poster="URL"&gt; Attribute Values: It contains a single value URL which s
1 min read
HTML | &lt;area&gt; target Attribute
The HTML &lt;area&gt; target Attribute is used to specify where to open the linked document. It works only when href attribute is present in the area elements. Syntax: &lt;area target="_blank|_self|_parent|_top|framename"&gt; Attribute Values: _blank: It opens the link in a new window._self: It is the default value. It opens the linked document in
1 min read
HTML | &lt;select&gt; autocomplete Attribute
The HTML &lt;select&gt; autocomplete attribute is used to specify that the form has autocompleted on or off. When the autocomplete attribute is set to on the browser will automatically complete the values based on which the user entered before. Syntax: &lt;select autocomplete="on | off"&gt; Attribute Values: on: It is the default value. When the au
1 min read
HTML &amp; CSS | Tabindex attribute &amp; Navigation bars
The tabindex attribute specifies the tab order of an element. "tab" button is used for navigation. The tabindex content attribute allows users to control whether an element is supposed to be focusable, whether it is supposed to be reachable using sequential focus navigation, and what is to be the relative order of the element for the purposes of se
2 min read
HTML | &lt;table&gt; bgcolor Attribute
The HTML &lt;table&gt; bgcolor Attribute is use to specify the background color of a table.Syntax: &lt;table bgcolor="color_name | hex_number | rgb_number"&gt; Attribute Values: color_name: It sets the text color by using the color name. For example "red".hex_number: It sets the text color by using the color hex code. For example "#0000ff".rgb_numb
1 min read
HTML | srcdoc Attribute
The HTML srcdoc attribute is used to specify the HTML content of the page to show in the inline frame. This attribute is anticipated to be used beside the sandbox and seamless attributes. If a browser supports the srcdoc attribute, it'll override the content laid out in the src attribute (if present). If a browser doesn't support the srcdoc attribu
1 min read
HTML &lt;video&gt; crossorigin Attribute
The HTML crossorigin attribute is used in the &lt;video&gt; element that supports a CORS request when we tried to fetch out the video files from the third-party servers or from another domain. Syntax: &lt;video crossorigin="anonymous | use-credentials"&gt; Attribute Values: anonymous: It has a default value. It defines a CORS request that will be s
1 min read
HTML | Marquee truespeed attribute
If the scrolldelay value less then 60 and truespeed mode is on then the value of scrolldelay is not effecting the scrolling. If the scrolldelay value more then 60 and truespeed mode is on then the truespeed is not effecting the scrolling. So, basically it is used to set scrollDelay attribute should be taken as an exact value or not.Syntax: &lt;marq
1 min read
What is the significance of adding autocomplete attribute in HTML Form ?
The HTML &lt;form&gt; autocomplete attribute is used to specify that the form has autocompleted on or off value. When the autocomplete attribute is set to "on", the browser will automatically complete the values based on which the user entered before. Syntax: &lt;form autocomplete="on|off"&gt; Attribute values: on: It has a default value. When the
1 min read
HTML | &lt;td&gt; abbr Attribute
The HTML &lt;td&gt; abbr attribute is used to specify the shorter version of the content. This attribute is not supported by HTML 5. It does not describe any visual effect but it is used by screen readers. Syntax: &lt;td abbr="text"&gt; Attribute Values: text: It contains the short description of cell content. Note : This attribute is not supported
1 min read