<!DOCTYPE html>
<html lang="en">
<head>
    <title>Fancy table</title>
    <style>
        .fancyTable {
            border: 1px solid;
            margin: 2rem;
        }

        .fancyTable tr {
            border: 1px solid;
            height: 20px;
        }

        .fancyTable td {
            border: 1px solid;
            width: 20px;
            background-color: white;
            white-space: nowrap;
        }

        .stripped td:nth-child(2n) {
            background-color: pink;
        }

        .checkerboard tr:nth-child(2n+1) td:nth-child(2n+1), .checkerboard tr:nth-child(2n) td:nth-child(2n) {
            background-color: pink;
        }
    </style>
</head>
<body>
<p>Fancy table! [<a href="./?source=alternating.php">source</a>]</p>
<table class="fancyTable stripped">
    <?php
    define
("ROW"10);
    
define("COL"15);
    for (
$i 1$i <= ROW$i++){
        echo 
"<tr>\n";
        for (
$j 1$j <= COL$j++){
            echo 
"<td>Row $i; Col $j</td>\n";
        }
        echo 
"</tr>\n";
    }
    
?>
</table>
<table class="fancyTable checkerboard">
    <?php
    
for ($i 1$i <= ROW$i++){
        echo 
"<tr>\n";
        for (
$j 1$j <= COL$j++){
            echo 
"<td>Row $i; Col $j</td>\n";
        }
        echo 
"</tr>\n";
    }
    
?>
</table>
</body>
</html>