CSS - background color of table row odd/even

后端 未结 9 959

I have a table that is dynamically generated by PHP. I am hoping that I can use CSS to apply a background color based on where the table row is odd/even, i.e. the backgroun

9条回答
  •  春和景丽
    2020-12-10 08:33

    Try this :

    css:

    .row0{
     background:white;
    }
    .row1{
     background:black;
    }
    

    in php while printing rows (trs)

    
    
    ...
    

提交回复
热议问题