<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> td { text-align:right; width:70px; border:2px solid #000000; } </style> <title> Boucle for en PHP, Création d'une table de multiplication. </title> </head> <body> Boucle for en PHP<br> Exemple de création de code HTML avec une boucle <b>for</b> en PHP.<br> Création d'une table de multiplication.<br> <br> <table style="border-collapse:collapse;"> <?php for ($ny=1; $ny<=10; $ny++) { echo "<tr>\n"; for ($nx=1; $nx<=10; $nx++) { echo " <td>".$nx*$ny." </td>\n"; } echo "</tr>\n"; } ?> </table> <br> <hr style="margin-left:0; width:95%"> <p style="margin-top:0; font-size:80%"> Plan du Site : <a href="../index.html">home de zgisin</a> <img src="images/arrow_right.gif" alt='arrow' width="13" height="9"> <a href="index.html">Home</a> <img src="images/arrow_right.gif" alt="arrow" width="13" height="9"> php06_boucle_for_table_mult.php </p> <hr style="margin-left:0; margin-bottom:0; width:95%"> <p style="margin-top:0; font-size:80%"> Page mise à jour le 1 décembre 2015 par Bernard Gisin<br> Hébergement par : <a href="http://www.infomaniak.ch">www.infomaniak.ch</a> </p> <br> </body> </html>