Advertisement
Militsa

17. RGB Table

Jan 3rd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>First Steps Into PHP</title>
  6.     <style>
  7.         table * {
  8.             border: 1px solid black;
  9.             width: 50px;
  10.             height: 50px;
  11.         }
  12.     </style>
  13. </head>
  14. <body>
  15. <table>
  16.     <tr>
  17.         <td>
  18.             Red
  19.         </td>
  20.         <td>
  21.             Green
  22.         </td>
  23.         <td>
  24.             Blue
  25.         </td>
  26.     </tr>
  27.     <!--Write your PHP Script here-->
  28.     <?php
  29.     for($i=51; $i <= 255; $i+=51) {
  30.         echo "<tr><td style='background-color: rgb($i, 0, 0)'></td><td style='background-color: rgb(0, $i, 0)'></td><td style='background-color: rgb(0, 0, $i)'></td></tr>";
  31.     }
  32.     ?>
  33. </table>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement