newbman Posted February 17, 2006 Share Posted February 17, 2006 I've made a table with anchors in them, but i have to click the text. Instead, i want to be able to click on any part of the td. Ne1 know how?-Newbman Link to comment Share on other sites More sharing options...
scott100 Posted February 18, 2006 Share Posted February 18, 2006 I've made a table with anchors in them, but i have to click the text. Instead, i want to be able to click on any part of the td. Ne1 know how?-Newbman <{POST_SNAPBACK}> Remove the anchor tags and put an onclick on the td's:<head><style>table{ cursor:pointer;}</style></head><body><table border="1" width="50%"><tr><td onclick='window.location="http://www.google.com"'>Visit Google</td><td onclick='window.location="http://www.yahoo.com"'>Visit Yahoo</td></tr><tr><td onclick='window.location="http://www.microsoft.com"'>Visit Microsoft</td><td onclick='window.location="http://www.w3schools.com"'>Visit W3Schools</td></tr></table></body> Link to comment Share on other sites More sharing options...
newbman Posted February 18, 2006 Author Share Posted February 18, 2006 TYVM-Newbman Link to comment Share on other sites More sharing options...
Jonas Posted February 19, 2006 Share Posted February 19, 2006 A better solution, if you want to accommodate people who have javascript disabled, use CSS on your links to make them the same width/height as your table cells:<style type="text/css"><!--td a {width: ##px;height: ##px;display: block;}--></style>And then just write your links in the <td>'s as you would normally.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now