我有一个冻结部分,其中列的no是动态的(即冻结部分中的列可以是1或2或3.)。
我要更改冻结列中值为"Total“的单元格的背景色。
我该怎么做?
发布于 2015-01-30 10:28:22
我试过了,得到了我想要的。
CSS
.Total
{
background-color: #5A0B0E !important;
}代码:
var cols = $("#list_frozen > tbody > tr:first-child > td, #list_frozen > tr:first-child > td").length;
for (var i = 1; i <= cols; i++) {
$("#list_frozen > tbody > tr , #list_frozen > tr ").each(function () {
$(this).find("td:nth-child(" + i + ")").each(function () {
if ($.trim($(this).text()) == "Total") {
$(this).addClass("Total");
}
});
});
}https://stackoverflow.com/questions/28084198
复制相似问题