Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <style>
- body {
- font-family: "Arial";
- }
- table {
- width: 500px;
- height: 500px;
- border: 1px solid black;
- padding: 0;
- }
- tr, td {
- padding: 0;
- margin: 0;
- }
- .white {
- }
- .black {
- background-color: black;
- }
- </style>
- </head>
- <body>
- <div align="center">
- <h1 style="color:blue">Šahovnica</h1>
- <p>Šahovnico izpiše PHP skript z zanko for</p>
- <table>
- <?php
- for ($i = 0; $i < 10; $i++) {
- echo "<tr>";
- for ($j = 0; $j < 10; $j++) {
- if (($i+$j) % 2 == 1) {
- echo "<td class='black'></td>";
- } else {
- echo "<td class='white'></td>";
- }
- }
- echo "</tr>";
- }
- ?>
- </table>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement