How to make whole table cell clickable but vertical align text inside it.
Alright it is achievable by making link display:block and setting line height.
But the problem开发者_如何学运维 is text may get 2 lines some times. So this way is not solution. Are there any other solution ?
thank you.
You could do this by adding a class to the cell you want to click and hooking this up using jquery such as
<td class="clickable">...</td>
your jquery...
$('.clickable').click(function() {
alert('Table cell has been clicked');
});
Yes you could do that but I usually need each cell to do something different or to send a different piece of data for each cell. So I use something like this.
<td onclick="update_calendar(1337317200);">19</td>
精彩评论