I have found 2 possible ways of making tr clickable:
- Using javascript:
<tr onclick="document.location = '...';">
- Using anchors:
<tr><td><a href="">text</a></td><td><a href="">text</a></td></tr>
with following css:
table tr td a {
display:block;
height:100%;
width:100%;
}
1-st way won’t be followed by search bots. In 2-nd case, we have too many similar links and I don’t know will it be good for them. Also it doesn’t work in some situations. I need to know for sure that pages will be followed and indexed.
I want to save table view, but seo optimization is more important. What is the best solution for me? Or 2-nd way is ok?
Use the
<a>normally and then dynamically add your document tracker to it with JavaScript after the page loads. It will be search engine friendly and still allow you to track links. (Although you really should be doing that server side).