請問大家下面php代碼報錯了,設(shè)置隔行換色,$bgcolor=$out%2==0?"#FFFFFF"??:"#DDDDDD";怎么糾正呢?
<?php
function?table(){
echo?"<table?align='center'?border='1'?width='600'>";
echo?"<caption><h1>通過函數(shù)輸出表格</h1></caption>";
for($out=0;$out<10;$out++){
$bgcolor=$out%2==0?"#FFFFFF"??:"#DDDDDD";
echo?"<tr?bgcolor=".$bgcolor.">";
for($in=0;$in<10;$in++)
{
echo?"<td>".($out*10+$in)."</td>";
}
echo "</tr>";
}
echo?"</table>";
}
?>
添加回答
舉報
0/150
提交
取消