Can someone help me please? I need a loop for a checkerboard pattern project.
Right now i have this:
<?php
$uitvoer="<table summary=''>\n";
$j=0;
$uitvoer .= "\t<tr>\n";
for($i=0;$i<8;$i++)
{
$uitvoer .= "\t\t<td class='kleur".(($i+$j)%2)."'> </td>\n";
}
echo <<<END
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Page title</title>
<style type="text/css">
<!--
td
{
width: 50px;
height: 50px;
border:4px groove red;
}
td.kleur0
{
background-color: white;
}
td.kleur1
{
background-color: black;
}
-->
</style>
</head>
<body>
$uitvoer
</body>
</html>
END;
?>
Then i get this:

So far so good.
But i need 8 rows with different lines and colors
The result need to be like this:

How can i do that the easiest and fastest way in a loop or a array??