I\'ve set up a fiddle with a table.
You see, Im trying to make a table where the user will hover and click the td to show an id. Check the fiddle out and you\'ll und
The href
property is designed for anchor elements (<a/>). "ahref" as you've put should be <a href="">
. a
is an element of its own, not a HTML attribute, and href
is an attribute it accepts.
To make the text of a td
clickable you can simply put an anchor within it:
<td>
<a href="#child4">My clickable text</a>
</td>
Edit: To fix this now that the question has been added, simply add in the following CSS:
td a {
display:block;
width:100%;
}
What this does is display the anchor tag as a block, allowing us to adjust the width, and then set the width to 100%, allowing it to fill the remaining space.
Working JSFiddle.