Javascript 如何将表tr转换为链接?

Javascript 如何将表tr转换为链接?,javascript,html,css,hyperlink,tablerow,Javascript,Html,Css,Hyperlink,Tablerow,以下是我当前的解决方案: <tr onclick="window.location = '/info/{{ match.login.id }}/'"> <td>{% if match.image %}<img src="{{ match.image|crop:'64x64' }}" alt="Match Avatar" />{% endif %}</td> <td>{{ match.team_name }}</td

以下是我当前的解决方案:

<tr onclick="window.location = '/info/{{ match.login.id }}/'">
    <td>{% if match.image %}<img src="{{ match.image|crop:'64x64' }}" alt="Match Avatar" />{% endif %}</td>
    <td>{{ match.team_name }}</td>
    <td>{{ model|distance_to:match }} {{ model.display_distance }}</td>
    <td>{% for expertise in match.expertise_list %}
            <span{% if expertise in model.expertise_list %} class="match"{% endif %}>{{ expertise }}</span><br />
    {% endfor %}</td>
    <td>{% if model|active_connection_with:match %}{{ model|status_with:match }}{% else %}<a href="javascript:connect({{ match.login.id }})" class="button">Connect</a>{% endif %}</td>

{%if-match.image%}{%endif%}
{{match.team_name}
{{model|distance_to:match}{{{model.display_distance}}
{match.experties_list%}中的专业知识为%
{{专家}}
{%endfor%} {%if模型|活动|连接_与:match%}{{model |状态_与:match}}{%else%}{%endif%}


但问题是,我希望能够右键单击并复制链接等。我如何才能做到这一点?

右键单击以复制链接仅在
a
标记上有效。您必须编写自己的右键点击工具。

右键点击复制链接只在
a
标记上有效。您必须编写自己的右键点击处理程序。

当您在表元素(tr、td、th)之间有HTML元素时,它是无效的标记(在浏览器上不起作用)

如果您的表格单元格太复杂,无法标记为链接,则可以使用不可见的

谷歌
雅虎
运输署{
位置:相对位置;
}
.覆盖{
背景色:透明;
位置:绝对位置;
宽度:100%;
身高:100%;
}
演示:

唯一的缺点是,用户无法选择它下面的文本。

当在表元素(tr、td、th)之间有HTML元素时,它是无效的标记(在浏览器上不起作用)

如果您的表格单元格太复杂,无法标记为链接,则可以使用不可见的

谷歌
雅虎
运输署{
位置:相对位置;
}
.覆盖{
背景色:透明;
位置:绝对位置;
宽度:100%;
身高:100%;
}
演示:


唯一的缺点是用户无法选择其下的文本。

可能的重复:我认为目的不同-不是“如何”,而是右键单击,这在另一个答案中没有提及。可能的重复:我认为目的不同-不是“如何”,而是右键单击,另一个答案中没有提到。你会怎么做?你会怎么做?
<table>
    <tr>
        <td>
            <a href="http://google.com" class="overlay"></a>
            Google
        </td>
        <td>
            <a href="http://yahoo.com" class="overlay"></a>
            Yahoo
        </td>
    </tr>

</table>

td {
    position: relative;
}

.overlay {
    background-color: transparent;
    position: absolute;
    width: 100%;
    height: 100%;

}