我有一個PHP while循環,它在一個表中顯示數據庫的內容。 我想使表中的所有行都有不同的顏色。PHP雖然 - 每次都改變顏色
但不只是隨機的。我希望他們有不同的紅色陰影,第一排最紅,其餘的則變成淺紅色。
作爲一個例子,我想要與iPhone App相同的效果:清除。 圖片示例:http://www.realmacsoftware.com/_resources/clear/images/ss_pinch.png
我試過在CSS和一些jQuery中使用-nth的效果,但只是想不出來。我希望你會試試看。
下面是代碼:
<table>
<tr>
<td align="center"><strong>Navn:</strong></td>
<td align="center"><strong>Spørgsmål:</strong></td>
<td align="center"><strong>Tid:</strong></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td><? echo $rows['name']; ?></td>
<td><? echo $rows['ask']; ?></td>
<td><? echo $rows['time']; ?></td>
<?php
}
?>
</tr>
</table>
你想要一個漸變。這與PHP無關。 –
你有什麼想法,我怎麼能做出這個效果呢? – MathiasJakobsen
僅限CSS,漸變。看到[這個答案](http://stackoverflow.com/questions/5973179/css-rounded-table-corners-gradient-background) –