Reputation: 71
I have got a table with a button in one of the cells. When I make the button a link, the whole button re-aligns to the top of the cell. How can I keep it in the middle?
<table class="table-class-1">
<tr>
<td class="td-class-1"><a href="/link"><div class="div-class-1">TEXT IN DIV</div></a>
</td>
</tr>
</table>
.table-class-1 {
max-width:550px;
margin: auto;
}
.td-class-1 {
text-align: center;
vertical-align: middle;
}
.div-class-1 {
background-color: #GGGGGG;
color: #fff;
text-align: center;
vertical-align: middle;
border-radius: 6px;
padding: 5px;
font-size: 18px;
}
Upvotes: 1
Views: 60
Reputation: 160
**This would help you. Simple and promising :)
Check out : http://jsfiddle.net/bV253/2/
Upvotes: 1
Reputation: 1297
You can try this:
<table class="table-class-1">
<tr>
<td class="td-class-1"><a href="/link"><div class="div-class-1">TEXT IN DIV</div></a>
</td>
</tr>
</table>
Good Luck....
Upvotes: 2