My desire is simple - to make a clickable cell (i.e. a cell with a link) with a minimum height requirement (in this case 40 pixels) ant vertically centered text. Here is what I came up with so far:
<html>
<head>
<style>
table.test td {
border:1px solid black;
width: 200px;
height: 100%;}
table.test td.cell a {
background-color: #FFF5EE;
display:inline-block;
height:100%; width:100%;
min-height: 40px;}
table.test td.cell a:hover, td.cell a:active {
background-color: #D2691E;}
</style>
</head>
<body>
<table class="test">
<tr>
<td class="cell"><a href="www.google.lt">Google</a></td>
<td>Line1</td>
</tr>
<tr>
<td class="cell"><a href="www.google.lt">Google</a></td>
<td>Line1<br>Line2<br>Line3</td>
</tr>
</table>
</table>
</body>
</html>
Everything is in order, but I can’t get the center alignment (center) vertically: / The property vertical-aligndoes not work in this case.
Here is an example in action ( link ).
source
share