我們想要做的是更改表格中行的背景顏色。每隔兩行顏色將會改變。公式每隔兩行更改一次
Our id sequence is simple as follow:
id = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,.....etc.
1,2 rows -> black
3,4 rows -> white
5,6 rows -> black
7,8 rows -> white
9,10 rows -> black
11,12 rows -> white
13,14 rows -> black
15,16 rows -> white
17,18 rows -> black
etc....
if(id==1) || (id==2) class="black";
if(id==3) || (id==4) class="white";
if(id==5) || (id==6) class="black";
if(id==7) || (id==8) class="white";
if(id==9) || (id==10) class="black";
if(id==11) || (id==12) class="white";
etc.....
根據id值,我們該如何改變顏色黑色或白色?
非常感謝。
嚴重的是,有圍坐在努力工作,這一點一組嗎?當天他們在學校教授模數算子,你們都在做什麼? (Google C#MOD)。 –
@James Gaunt你花時間評論和侮辱而不是回答? –
當然,我知道自C++以來的模數運算符。找到偶數或奇數很有用。那麼實現黑色或白色的最佳方程是什麼? –