0

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

<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>  
4

1 回答 1

0

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>
于 2013-06-02T00:44:53.420 回答