html - 如何制作表格超链接的单元格

标签 html hyperlink href

如何在没有 javascript 或 jquery 的情况下在 html 中对整个表格单元格进行超链接?

我试图将 href 放在 td 标签中,但它至少在 chrome 18 中不起作用

<td href='http://www.m-w.com/dictionary/' style="cursor:pointer">

最佳答案

试试这个:

HTML:

<table width="200" border="1" class="table">
    <tr>
        <td><a href="#">&nbsp;</a></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>

CSS:

.table a
{
    display:block;
    text-decoration:none;
}

希望一切顺利

关于html - 如何制作表格超链接的单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10070232/

相关文章:

javascript - 相对位置

jquery - 如何使输入下的所有内容都具有静态位置?

javascript - 如何让 anchor 链接在 Jquery Mobile 中工作?

Android/iPhone 链接样式

javascript - jQuery 仅部分替换 href 值?

html - 服务器响应状态为500(服务器错误)

javascript - 如何制作悬停效果而不是在 bootstrap 4 下拉菜单中单击?

html - 折叠表格并删除 HTML 中的填充

Excel通过公式动态超链接

javascript - 将数据保存到我的网站中的 firebase 后无法重定向到另一个 html 文件