【phpの復習】
【phpの復習】
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>繰り返し回数を出力する</title> <style type="text/css"> table { width:400px; margin:0 auto; } </style> </head> <body> <table border="5"> <tr><th>イメージ</th><th>商品名</th></tr> <?php for($i=0; $i<6; $i++ ){ print ("<tr>"); print ("<td><img src=\"img/{$i}.jpg\"></td> <td>商品{$i}</td>"); print ("</tr>\n"); } ?> </table> </body> </html>