Reputation: 440
Update : JS Fiddle for this issue : http://jsfiddle.net/Ey4aH/2/ , run it in IE and see the problem.
I am using the below code, which is a part of set of menu's.
<div class="profile-menu">
<ul>
<li><a class="current" href="javascript:void('0');">
<table width="153" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22"><img src="images/about-icon.png" width="16" height="16" /></td>
<td width="135">About</td>
</tr>
</table>
</a> </li>
<li><a href="/friend/viewfriends/<%=temp.getString("user_id")%>">
<div><table width="153" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22"><img src="images/friends-icon.png" width="16" height="16" /></td>
<td width="135">Friends</td>
</tr>
</table></div>
</a>
</li></ul></div>
This works fine with other browsers, but in IE, when i try to click Friends text link, it is not working. But when i click the icon, it is working fine. Can anyone help me find what is the issue.
Upvotes: 0
Views: 761
Reputation: 21050
It looks as if you're using a table to display content when tables are only supposed to be used to display tabular data.
'A' tags can not contain tables or other block level elements and be expected to play nice across all browsers.
The best solution would be to recreate your design without using tables.
Alternatively you could achieve what you're trying to do by using javascript to enable the click, on the table.
HTML5 allows block level elements to be wrapped within 'a' tags:
http://davidwalsh.name/html5-elements-links
Upvotes: 1
Reputation: 4195
it is better if you don't use table inside <a>
tag .
but use <a>
tag inside each <td>
elements .
Upvotes: 1