Vertical alignment in table cells
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
td,th { height: 150px; width: 72px; text-align: center; }
#row1 { vertical-align: top; }
#row2 { vertical-align: middle; }
#row3 { vertical-align: bottom; }
</style>
</head>
<body>
<table border="1" cellspacing="0">
<tr id="row1">
<th>top align</th>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
</tr>
<tr id="row2">
<th>middle align</th>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
</tr>
<tr id="row3">
<th>bottom align</th>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
<td><img src="http://java2s.com/style/logo.png" alt=""></td>
</tr>
</table>
</body>
</html>
Related examples in the same category