<table border="0" cellspacing="0" cellpadding="0" >
<tr>
<?php
while ($pF = mysql_fetch_array($stringVisits)) {
?>
<td class="viewercell" style="color: #CCC; font-size: 10px;">
<?php
echo "<a href='profil.php?id=".$BuID."'>";
echo "<img style='margin-right: 5px; width: 61px; height: 80px;'";
if (checkStatus($BuID) == 1) {
echo 'class="onlineBorder" ';
} else {
echo 'class="image-xxsmall-border" ';
}
echo " src='images/profilePhoto/thumbs/";
if (!empty($getByProfile["photo_thumb"])) {
echo $getByProfile["photo_thumb"];
} else {
echo "noPhoto_thumb.jpg";
}
echo "'>";
?>
</a>
</td>
<?php } ?>
</tr>
</table>
這就是我現在所顯示的訪問者的profileimage。現在我想要在圖片下面顯示他們的名字..但是之後我需要在此之後創建另一個<tr>
,並在每個<td>
中添加他們的名字。但是,如果我有這個時間,我該怎麼做呢?我應該再運行一次,獲取名字還是我可以做一些聰明的事情?PHP:用tr和td一起使用while()
該表將與所有行相乘,我希望它們都在1個表內。 – Johnson 2010-10-31 22:54:42
將表格標籤放在循環之外我會編輯它,以便您可以看到 – Mars 2010-10-31 23:13:52