Advertisement
dysphafiz_

Untitled

Oct 29th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.58 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Kasus 1</title>
  5.     <style type="text/css">
  6.         body{
  7.             font-family: verdana;
  8.             background-color: gainsboro;
  9.         }
  10.         form{
  11.             width: 670px;
  12.         }
  13.         table{
  14.             width: 650px;
  15.             text-align: center;
  16.             margin-right: auto;
  17.             margin-left: auto;
  18.             background-color: silver;
  19.             border: 3px orange outset;
  20.         }
  21.  
  22.         input[type="number"]{
  23.             border-radius: 7px;
  24.             background-color: silver;
  25.             width: 30px;
  26.             transition: 0.4s;
  27.         }
  28.  
  29.         input[type="number"]:focus{
  30.             width: 120px;
  31.             text-align: center;
  32.         }
  33.  
  34.         input[type="submit"] {
  35.             background-color: silver;
  36.             padding: 7px;
  37.             width: 48px;
  38.             font-size: 12px;
  39.             border: 2px orange solid;
  40.             border-radius: 5px;
  41.             transition: 0.4s;
  42.             cursor: pointer;
  43.         }
  44.  
  45.         input[type="submit"]:hover{
  46.             background-color: orange;
  47.            
  48.         }
  49.     </style>
  50. </head>
  51. <body>
  52.     <form method="post" action="">
  53.     <h1>Form Input Data Siswa</h1>
  54.     <p>Masukkan jumlah Siswa <input type="number" name="j_siswa">&emsp;<input type="submit" name="submit" value="ok"></p>
  55.  
  56.         <table cellspacing="1" cellpadding="1" >
  57.             <tr>
  58.                 <td>No</td>
  59.                 <td>NIS</td>
  60.                 <td>Nama</td>
  61.                 <td>Alamat</td>
  62.             </tr>
  63.            
  64.             <?php
  65.             if (isset($_POST['submit'])) {
  66.                 $siswa = $_POST['j_siswa'];
  67.                 for ($i=1; $i <= $siswa; $i++) {
  68.                     echo "<tr>
  69.                 <td><input type='text' name='no' value='$i'size='1'></td>
  70.                 <td><input type='text' name='nis'></td>
  71.                 <td><input type='text' name='nama'></td>
  72.                 <td><input type='text' name='alamat'></td>
  73.             </tr>";
  74.                 }
  75.             }  
  76.             ?>
  77.         </table>
  78.     </form>
  79. </body>
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement