Tables
|
|
|
|
<?
$y = 0;//will be needed later to make counter inside the loop
function foxcol($x)// The function which will print the color name
{
$x++;
if ($x%2 > 0.5)
{
print("red");
}
else
{
print("yellow");
}
}
?> <table width="100%" border=1>
<?
for ($i = 0; $i < 14; ++$i)://The loop inwhich rows will be repeated
++$y;// The counter which will passed throgh the function to produce the color
?> <tr bgcolor="<?foxcol($y)?>">
<td> </td>
<td> </td>
</tr>
<?
endfor;
?> </table>
|
|
|
Usage Example
|
|
|
Rate This Script
|
|
|
|