Table color problems. Newbie: this is the code I just typed. I originally wanted a line of yellow and a line of colorless, but I don't know how it turned into completely yellow. please help me see & lt; table & nbsp; border = "1" & gt; & lt ;? Phpfor ($ I = 1; & nbsp; $ I & lt; = 9; & nbsp; $ I + table color problem. Beginner
This is the code I just typed. I originally thought it was a line of yellow and a line of colorless, but I don't know how it turned completely yellow. let's take a look.
for($i=1; $i<=9; $i++)
{
for($n=1; $n<9; $n++)
{
if($n%2==0)
{
echo '
';
}
else
{
echo '';
}
}
for($j=1; $j<=$i; $j++)
{
$c = $i * $j;
echo "".$j."*".$i."=".($i*$j)."
"."" ;
}
echo "
";
}
?>
------ Solution --------------------
for($i=1; $i<=9; $i++)
{
if($i%2==0)
{
echo '
';
}
else
{
echo '';
}
for($j=1; $j<=$i; $j++)
{
$c = $i * $j;
echo "".$j."*".$i."=".($i*$j)."
"."" ;
}
echo "
";
}
?>
------ Solution --------------------
Echo"
"; Remove this.
------ Solution --------------------
Not matching
echo '
';
for($i=1; $i<=9; $i++) {
for($n=1; $n<9; $n++){
if($i%2==0) {
echo '
';
}else {
echo '';
}
}
for($j=1; $j<=$i; $j++) {
$c = $i * $j;
echo "".$j."*".$i."=".($i*$j)." " ;
}
echo "";
}
echo '';