web api instance property
HTMLTableColElement: vAlign property
The vAlign property of the HTMLTableColElement interface is a string indicating how to vertically align text in a table <col> column element.
[!NOTE] This property is deprecated, and CSS should be used to align text vertically in a column. Use the CSS
vertical-alignproperty, which takes precedence, to vertically align text in each column cell instead.As
<td>are not children of<col>, you can’t set it directly on a<col>element, you need to select the cells of the column using atd:nth-child(n)or similar (nis the column number).
Value
The possible values are: "top", "middle", "bottom", or "baseline"
top- : Align the text to the top of the column. Use
vertical-align: topinstead.
- : Align the text to the top of the column. Use
center- : Vertically center the text in the column. Synonym of
middle. Usevertical-align: middleinstead.
- : Vertically center the text in the column. Synonym of
middle- : Vertically center the text in the column. Use
vertical-align: middleinstead.
- : Vertically center the text in the column. Use
bottom- : Align the text to the bottom of the column. Use
vertical-align: bottominstead.
- : Align the text to the bottom of the column. Use
baseline- : Similar to
top, but align the baseline of the text as close to the top so no part of the character is outside of the cell.
- : Similar to
Examples
Use CSS vertical-align. As <td> elements of a column are not children of <col>, you can’t set it directly on a <col>, you need to select the cells using a td:nth-child(n) or similar (n is the column number).
An example is available on the :nth-child() page.