我在我的應用程序中使用了數據表jQuery。當我使用數據表jQuery爲我的行設置替代顏色時,我遇到了一個問題。也就是說,在表格中,第2,3,4,第5,第6行全部以相同顏色顯示,之後交替顯示顏色。任何人都可以幫助我嗎?提前致謝。datatables jquery - 備用顏色的行
我在jquery.datatables.css代碼:
table.dataTable tr.odd { background-color: red; }
table.dataTable tr.even { background-color: green; }
我附加表的截圖。
當我檢查,每行有兩種類=「偶」或類=「奇」,但第2,第3,第4,第5,第6行上課=「奇偶」。我不知道爲什麼它是這樣的。
OP使用類,如'odd'和'even',我建議'CSS pseudos' –
哦,是我不好,對不起,沒看到! +1 –
嘗試...但不工作......謝謝 – kishore