Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <style>
- table {
- width:400px;
- height:400px;
- }
- </style>
- </head>
- <body>
- <?php
- echo "<table border=1>";
- $k=9;
- $n=9;
- for($i=0;$i<$k;$i++)
- {
- if($i%2!=0)echo "<tr style='background-color: lightgrey;'>";
- else "<tr>";
- for($j=0;$j<$n;$j++)
- {
- if($j%2!=0 && $i%2==0) echo "<td style='background-color:lightgrey'></td>";
- else if($j%2!=0 && $i%2!=0)echo "<td style='background-color:grey'></td>";
- else echo "<td></td>";
- }
- echo "</tr>";
- }
- echo "</table>";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement