HTML DOM verticalAlign Property
Complete Style Object Reference
Definition and Usage
The verticalAlign property sets the vertical alignment of content in an element box.
Syntax
Object.style.verticalAlign=value
|
Possible Values
Value |
Description |
baseline |
The element is placed on the baseline of the parent
element |
sub |
Aligns the element as it was subscript |
super |
Aligns the element as it was superscript |
top |
The top of the element is aligned with the top of the
tallest element on the line |
text-top |
The top of the element is aligned with the top of the
parent element's font |
middle |
The element is placed in the middle of the parent
element |
bottom |
The bottom of the element is aligned with the lowest
element on the line |
text-bottom |
The bottom of the element is aligned with the bottom of
the parent element's font |
length |
|
% |
Aligns the element in a % value of the "line-height"
property. Negative values are allowed |
Example
The following example changes the vertical alignment of text in a table:
<html>
<head>
<script type="text/javascript">
function alignText()
{
document.getElementById("td1").style.verticalAlign="bottom";
}
</script>
</head>
<body>
<table border="1" height="100px">
<tr>
<td id="td1">
Some example text
</td>
</tr>
</table>
<br />
<input type="button" onclick="alignText()"
value="Align text" />
</body>
</html>
|
Try-It-Yourself Demos
verticalAlign - Vertical align text in a table
Complete Style Object Reference
Make your web applications look like a million bucks
|
|
Most web applications today use boring methods to present data to their viewers using grids or simple HTML tables. FusionCharts induces "life" into the web applications by converting monotonous data into lively charts, gauges & maps.
FusionCharts works with all technologies like ASP, ASP.NET, PHP, ColdFusion, Ruby on Rails, JSP, HTML pages etc.
and connects to any database to render animated & interactive charts. It takes less than 15 minutes and no expertise
whatsoever to build your first chart and just a glance of it to captivate your audience. This fact is endorsed by our
12,000 customers and 150,000 users which include a majority of the Fortune 500 companies.
And yeah, your applications could look like a million bucks by spending just $69.
So go ahead, download your
copy of FusionCharts and start "wow-ing" your customers now!
|
|