Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <html>
  2. <head>
  3. <style>
  4. table {
  5.  
  6. width:400px;
  7. height:400px;
  8. }
  9.  
  10. </style>
  11. </head>
  12. <body>
  13. <?php
  14. echo "<table border=1>";
  15. $k=9;
  16. $n=9;
  17. for($i=0;$i<$k;$i++)
  18. {
  19. if($i%2!=0)echo "<tr style='background-color: lightgrey;'>";
  20. else "<tr>";
  21. for($j=0;$j<$n;$j++)
  22. {
  23. if($j%2!=0 && $i%2==0) echo "<td style='background-color:lightgrey'></td>";
  24. else if($j%2!=0 && $i%2!=0)echo "<td style='background-color:grey'></td>";
  25. else echo "<td></td>";
  26.  
  27. }
  28. echo "</tr>";
  29. }
  30. echo "</table>";
  31. ?>
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement