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

nike_ljq 2002-07-24 02:39:24
谢谢!
...全文
5 点赞 收藏 5
写回复
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
21bird 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>
回复
21bird 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) ? "深色" : "浅色";
回复
发动态
发帖子
基础编程
创建于2007-09-28

2.1w+

社区成员

从PHP安装配置,PHP入门,PHP基础到PHP应用
申请成为版主
社区公告
暂无公告