Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- <style>
- h1 {
- color: red;
- }
- .odd {
- background-color: beige;
- width: 75px;
- height: 75px;
- }
- .even {
- background-color: brown;
- width: 75px;
- height: 75px;
- }
- </style>
- </head>
- <body>
- <?php
- $x_vak = 8;
- echo "<h1>hello</h1><br>";
- echo "<table>";
- $x = 1;
- $y = 1;
- for ($x > 0; $x < $x_vak; $x++) {
- if ($x & 1) {
- echo "<tr>";
- while ($y < $x_vak) {
- $y++;
- if ($y & 1) {
- echo "<td class ='even'></td>";
- } else {
- echo "<td class ='odd'></td>";
- }
- }
- $y = 1;
- echo "</tr>";
- } else {
- echo "<tr>";
- while ($y < $x_vak) {
- $y++;
- if ($y & 1) {
- echo "<td class = 'odd'></td>";
- } else {
- echo "<td class = 'even'></td>";
- }
- }
- $y = 1;
- echo "</tr>";
- }
- }
- echo "</table>";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement