Advertisement
dysphafiz_

Untitled

Oct 2nd, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.65 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Array 2D dan Looping</title>
  5.     <style type="text/css">
  6.         body{
  7.             background-color: gainsboro;
  8.             font-family: verdana;
  9.             font-size: 20px;
  10.         }
  11.     </style>
  12. </head>
  13. <body>
  14. <?php
  15.     $siswa = array(array("1314114590","Tony","MIF1"), array("1314114592","Thor","MIF2"), array("1314114593","Bruce","MIF3"));
  16.     echo '<table border=1 cellspacing=3 cellpadding=3>
  17.             <tr>
  18.                 <th>NIS</th>
  19.                 <th>NAMA</th>
  20.                 <th>KELAS</th>
  21.             </tr>';
  22.     for ($i=0; $i < 3; $i++) {
  23.         echo '<tr>';
  24.         for ($j=0; $j < 3; $j++) {
  25.             echo'<td>'.$siswa[$i][$j].'</td>';
  26.         }
  27.         echo '</tr>';
  28.     }
  29.     echo "</table>";
  30. ?>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement