html - 表格行就像一个链接 [英] html - table row like a link
问题描述
我无法将表格行设置为指向某些内容的链接.我只能使用 css 和 html.我尝试了从 div in row 到另一个不同的东西,但仍然无法使其正常工作.
I can't set my table row as link to something. I can use only css and html. I tried different things from div in row to something another, but still can't make it works.
推荐答案
您有两种方法可以做到这一点:
You have two ways to do this:
使用 JavaScript:
Using javascript:
使用锚点: <代码><tr><td><a href="">text</a></td><td><a href="">text</a></td></tr> 我使用: 消除列之间的死区: 这是第二个例子的简单演示:DEMO Here is a simple demo of the second example: DEMO 这篇关于html - 表格行就像一个链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
table tr td a {
display:block;
height:100%;
width:100%;
}
table tr td {
padding-left: 0;
padding-right: 0;
}
登录
关闭