Is it possible to do alternating row background colours in FullCalendar?

后端 未结 4 1650
执念已碎
执念已碎 2021-01-25 06:41

I applied an odd/even class to the fc-agenda-slot tr\'s, but the problem is the left/right \"cell\" border is on the fc-agenda-days table which is below, so it\'s not shown when

4条回答
  •  梦谈多话
    2021-01-25 07:18

    I had the same issue and I adopted this trick: You can use an opacity attribute on the row's cssClass.

    .fc-agenda-slots tr:nth-child(4n+1) td, .fc-agenda-slots tr:nth-child(4n+2) td { background-color:#E7F3F4; opacity:0.5; }

    .fc-agenda-slots tr:nth-child(4n-1) td, .fc-agenda-slots tr:nth-child(4n) td    {
        background-color:#F3F9FA;
        opacity:0.5;
    }
    

    This will show the border of cells, but only with cell background color opacized.. It's not the best solution ever, but it can be enough to get something fancy if you have no strong graphic constraints!

    Cheers

提交回复
热议问题