就象这个页面怎么一道浅色,一道深色阿!

nike_ljq 2002-07-24 02:39:24
谢谢!
...全文
42 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
某鸟 2002-07-24
  • 打赏
  • 举报
回复
看看我的:)
<table width="90%" border="0" bordercolor="#99CCFF">
<?
//display the news titles and others
$rdc = true;
while($aRow = mssql_fetch_array($r)){
if($idc){$rowColor = $color1;}
else $rowColor = $color2;
$idc=!$idc;
?>
<tr bgcolor = "<?=$rowColor?>"">
<td width="65%" height="30">
<?
echo "<a href = './news/" . $aRow["news_id"] . ".php" . "' class = 'newslist'>" . $aRow["title"] . "</a>";
?>
</td>
<td width="14%" height="30" align="center">
<?
echo $aRow["author_name"];
?>
</td>
<td width="13%" height="30" align="center">
<?
echo $aRow["times"];
?>
</td>
<td width="8%" height="30" align="center">
<?
echo "<a href = delet.php?id=" . $aRow["news_id"] . "><font color = '#ff0000'>删 除</font></a>";
?>
</td>
</tr>
<?
}//end the "while" loop
?>
</table>
某鸟 2002-07-24
  • 打赏
  • 举报
回复
看看我的:)
<table width="90%" border="0" bordercolor="#99CCFF">
<?
//display the news titles and others
$rdc = true;
while($aRow = mssql_fetch_array($r)){
if($idc){$rowColor = $color1;}
else $rowColor = $color2;
$idc=!$idc;
?>
<tr bgcolor = "<?=$rowColor?>"">
<td width="65%" height="30">
<?
echo "<a href = './news/" . $aRow["news_id"] . ".php" . "' class = 'newslist'>" . $aRow["title"] . "</a>";
?>
</td>
<td width="14%" height="30" align="center">
<?
echo $aRow["author_name"];
?>
</td>
<td width="13%" height="30" align="center">
<?
echo $aRow["times"];
?>
</td>
<td width="8%" height="30" align="center">
<?
echo "<a href = delet.php?id=" . $aRow["news_id"] . "><font color = '#ff0000'>删 除</font></a>";
?>
</td>
</tr>
<?
}//end the "while" loop
?>
</table>
wasy 2002-07-24
  • 打赏
  • 举报
回复
<?
$arr=array('a','b','c','d','e','f');
echo "<table border=1 width=200>";
for($n=0;$n<count($arr);$n++){
if($n%2){
echo "<tr style='background:#ff0000;'><td>".$arr[$n]."</td></tr>";
}else{
echo "<tr style='background:#00ff00;'><td>".$arr[$n]."</td></tr>";
}
}
echo "</table>";
?>
saimen2002 2002-07-24
  • 打赏
  • 举报
回复
static $flag=0;

if($flag==0)
{echo "<img src=\"red.gif\">";$flag=1;}
else if($flag==1)
{echo "<img src=\"blue.gif\">";$flag=0;}
xoyoren 2002-07-24
  • 打赏
  • 举报
回复
for ($i=0;$i<20;$i++)
print ($i % 2) ? "深色" : "浅色";

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧