通过html和wordpress函数使表中的一行完全可点击

Making a row in a table fully clickable via html and wordpress functions

本文关键字:一行 wordpress html 函数 通过      更新时间:2023-09-26

所以我试图使行在表中完全可点击。有什么特别的原因,为什么第一行没有使整个行成为一个链接?如果你看到问题,请告诉我。

<tr onclick="DoNav('https://www.math.wisc.edu/undergraduate/mathlab');">
<td align ="center" >
<div id ="org_logo"> <img src =""width = "150"; </div> 
Math Lab
</td>
<td> 
Math 101, 112, 113, 114, 141, 171, 211, 213, 221, 222, 234, 240
</td>
<td>
Mathlab is a free, drop-in tutorial program of the Department of Mathematics. It is      primarily staffed by Mathematics Department teaching assistants. Mathlab is open both in the fall and spring semesters of each academic year, but is closed during the summer sessions. In Mathlab, students work together with other students in the same course. Mathlab assistants help with one or two homework problems at a time, or with key examples from the text. </td>
</tr>  

DoNav是一个PHP函数,它位于服务器端。你不能从onclick调用它。相反,使用JavaScript将文档位置设置为目标。

您可能应该使用CSS来格式化表格,而不是align="center",并使用下划线向用户表明行是链接,但是,无论如何,下面的代码都可以工作:

 <table>    
       <tr onclick="document.location='https://www.math.wisc.edu/undergraduate/mathlab';">
          <td align="center" >
             <div id ="org_logo"><img src ="" width = "150" alt="Math Lab Logo"></div> 
             Math Lab
         </td>
         <td> 
            Math 101, 112, 113, 114, 141, 171, 211, 213, 221, 222, 234, 240
        </td>
        <td>
        Mathlab is a free, drop-in tutorial program of the Department of Mathematics. It is  primarily staffed by Mathematics Department teaching assistants. Mathlab is open both in the fall and spring semesters of each academic year, but is closed during the summer sessions. In Mathlab, students work together with other students in the same course. Mathlab assistants help with one or two homework problems at a time, or with key examples from the text.
      </td>
     </tr>  
    </table>