html - 表行像一个链接 [英] html - table row like a link
本文介绍了html - 表行像一个链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法将我的表格列设为连结。我只能使用css和html。
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 onclick =document.location ='links.html';>
< tr>< td>< a href => text< / a>< / td> td>< a href => text< / a>< / td>< / tr>
我使用的第二个工作:
table tr td a {
display:block;
height:100%;
width:100%;
}
要消除列之间的死区:
table tr td {
padding-left: 0;
padding-right: 0;
}
这是第二个例子的简单演示: DEMO
Here is a simple demo of the second example: DEMO
这篇关于html - 表行像一个链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文