0
我需要打印多行并在每行内多个td
s ...s后应该添加tr
但我不确定如何处理此问题。使用php和sql值打印表格
echo '<table>';
for($counter=0; $counter <= $row2 = mysql_num_rows($result2);counter++) {
print("<tr>");
while($row2 = mysql_fetch_array($result2)) {
$_name = $row2["_name"];
$_image = $row2["_image"];
print("<td valign='top' width='230px' height='148px'>");
print("<p class='p_imageStyle'>$_name</p>");
print("<img class='custom' alt='' src='$_image' />");
print("</td>");
}
print("</tr>");
}
echo '</table> ';
不要[做](http://www.hotdesign.com/seybold/everything.html),做[现代的东西(http://www.google.co。 uk/search?sourceid = chrome&ie = UTF-8&q = photo + grid + css)。 – Quentin
有人发布了一个答案,它的工作..请转贴,以便我可以承认您的回应...它是唯一缺少增加计数器。 – user710502