📜  引导表条纹隐藏行 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:20.809000             🧑  作者: Mango

代码示例1
// For Bootstrap 4
$("tr:visible").each(function (index) {
    $(this).css("background-color", !!(index & 1)? "rgba(0,0,0,.05)" : "rgba(0,0,0,0)");
});

// For previous versions
$("tr:not(.hidden)").each(function (index) {
    $(this).toggleClass("stripe", !!(index & 1));
});