'vertical-align' Example : vertical align « CSS Attributes and Javascript Style Properties « HTML CSS Reference






'vertical-align' Example

    
<html>
<body>
<table width="70%" border="1" cellspacing="5" cellpadding="5">
   <tr height="50">
      <td>Cell 1 content</td>
      <td>Cell 2 content</td>
   </tr>
   <tr height="100" id="myT">
       <td><img src="http://www.java2s.com/style/logo.png">Cell 3 text content</td>
       <td>Cell 4 text content</td>
   </tr>
</table>
<br>
<input type="button" 
       onclick="myT.style.verticalAlign='text-top'" 
       value="Set verticalAlign to text-top">
<input type="button" 
       onclick="myT.style.verticalAlign='text-bottom'" 
       value="Set verticalAlign to text-bottom">
<input type="button" 
       onclick="myT.style.verticalAlign='top'" 
       value="Set verticalAlign to top">
<input type="button" 
       onclick="myT.style.verticalAlign='bottom'" 
       value="Set verticalAlign to bottom">
<input type="button" 
       onclick="myT.style.verticalAlign='auto'" 
       value="Restore position">
</body>
</html>

    
      
      








Related examples in the same category

1.'vertical-align' Syntax and Note
2.'vertical-align' Possible Values
3.'vertical-align' is applied to