This question already has answers here:
Expand an <a> tag to fill the space
                                
                                    (6个答案)
                                
                        
                                2年前关闭。
            
                    
我想使用href标签使表格的某些元素可点击。目前,我只能使td元素内的文本可单击,但我希望整个元素都可单击。

下面的版本工作正常:

<table>
    <tr>
      <td><a href="link">Click</a></td>
    </tr>
</table>

最佳答案

在您的td上添加onclick:



<table>
    <tr>
      <td onclick="location.replace('https://www.sociat.com')">Click</td>
    </tr>
</table>

关于html - 使用href使td元素可点击,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47206297/

10-10 01:19
查看更多