Maison  >  Questions et réponses  >  le corps du texte

JS怎么给每相隔一行的TD添加filter滤镜?

项目要兼容IE8,其中用了大量的半透明效果,现在要求给表格的每相隔一行的TD添加一个深背景以区分,所以不能写死,请问怎么实现

大家讲道理大家讲道理2869 Il y a quelques jours1141

répondre à tous(2)je répondrai

  • 代言

    代言2016-11-12 13:51:20

    ie8有点难办了,如果是几个表格还能用:first-child+li+li{}这样的笨方法,大量的话又不想引用selectivizr.js这样大的组件。1:在js插入数据时动态添加类名,2:后端传入数据时带入类名标识。

    répondre
    0
  • 代言

    代言2016-11-12 13:51:07

    dt:nth-child(odd){    background-color: red}dt:nth-child(even){    background-color: #e1e1e1}


    répondre
    0
  • Annulerrépondre