gpt4 book ai didi

php - 使用 php 链接表中的项目

转载 作者:太空宇宙 更新时间:2023-11-03 12:23:49 27 4
gpt4 key购买 nike

我想弄清楚如何在保持行就位的同时链接表格行中的项目,我有以下代码:

echo "<br><br><table border=0 cellpadding=3>";
echo "<td><b>Player Name</b></td>";
echo "<td><b>Position</b></td>";
echo "<td><b>Height</b></td>";
echo "<td><b>Weight</b></td>";
echo "<td><b>Birthdate</b></td>";
echo "<td><b>NHL Rights</b></td>";
echo "<td><b>CNGHL Team</b></td>";
echo "<td><b>Current Team</b></td>";
echo "<td><b>Current League</b></td>";

while($row = mysql_fetch_array($oteaminfo))
{
echo "<tr>";
echo "<td>".$row['FullName']."</td> ";
echo "<td>".$row['Position']."</td> ";
echo "<td>".$row['Height']."</td> ";
echo "<td>".$row['Weight']."</td> ";
echo "<td>".$row['DOB']."</td> ";
echo "<td>".$row['Team']."</td> ";
echo "<td>".$row['CNGHLRights']."</td> ";
echo "<td>".$row['InternationalTeam']."</td> ";
echo "<td>".$row['InternationLeague']."</td> ";
echo "</tr>";
}
echo "</table>";

我试过用

     echo "<a href=\"cnghlplayers.php?  PlayerID=".$row['PlayerID']."\">".$row['FullName']."<br>";

代替

      echo "<td>".$row['FullName']."</td> ";

在表中,但它将链接放入当前表上方的新行中。任何帮助将不胜感激,我尝试搜索此主题但找不到任何有用的信息。

谢谢!

最佳答案

只需包装 <td>周围元素:

echo '<td><a href="cnghlplayers.php?PlayerID='.$row['PlayerID'].'">'.$row['FullName'].'</a></td>';

关于php - 使用 php 链接表中的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18562818/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com