SlickGrid 2.0 can't change row background color in odd indexes

心已入冬 提交于 2019-12-05 08:39:50

Your Unverified CSS class gets applied, but has no effect because it's specificity is lower than what is defined in slick-default-theme.css:

.slick-row.odd {
  background: #fafafa;
}

Notice that the selector uses a combination of two classes, which is more specific than your single Unverified class, hence it takes precedence.

You have two options:

  1. Remove the existing rule.
  2. Increase the specificity of your rule by adding .slick-row and placing it after the existing rule in the document, or by adding ! important at the end of your style declaration.

Neither of Tin's answers worked for me.

I was using:

.slick-row[row$="1"], .slick-row[row$="3"], .slick-row[row$="5"], .slick-row[row$="7"], .slick-row[row$="9"] {
  background: #E2E4FF;

}

But adding this to my CSS did:

.slick-row.odd {
  background: #E2E4FF;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!