I am building an HTML email and want to make an entire table clickable.
I have already come up with a JavaScript solution to do this, which works perfectly well however I would prefer to just wrap the table in tags and not use JavaScript.
<a href="#">
<table border="0">
<tr>
<td style="width: 100px; height: 100px">
</td>
</tr>
</table>
</a>
This works well enough in Firefox although it is not valid HTML given I'm enclosing a block level element () within an inline one ().
I currently don't have the means to test this on all email platforms so would like to know if there are any known email platforms that will not support this approach?
Any help would be greatly appreciated.
If anyone is looking for a JavaScript solution to perform the same function then here is one below:
<html>
<head>
<title></title>
<script type="text/javascript">
function link(url){
alert("url is "+url);
}
</script>
</head>
<body>
<table style="background-color: red" border="0" onclick="link('test url');" onmouseover="this.style.cursor='pointer';">
<tr>
<td style="width: 100px">This is a </td>
<td style="width: 100px; background-color: blue">test </td>
<td style="width: 100px">table </td>
</tr>
</table>
</body>
</html>