Tablesorter 主题,单击按钮时更改行背景

Tre*_*ski 3 css jquery tablesorter css-tables

我正在使用 tablesorter 2.0,并且我一直在尝试在单击按钮时覆盖 css 主题,但我似乎无法进行任何操作。我试图在主题文件中添加一些 css,但我认为另一个属性覆盖了它。我想要做的是更改某个类的行的背景颜色

如果有人可以查看并告诉我将类和属性添加到此文件的位置,我们将不胜感激。

这是 tablesorter 的主题文件:

table.tablesorter {
    font-family:arial;
    background-color: #CDCDCD;
    margin:10px 0pt 15px;
    font-size: 8pt;
    width: 100%;
    text-align: left;
    border-radius:3px;
}
table.tablesorter thead tr th, table.tablesorter tfoot tr th {
    background-color: #e6EEEE;
    border: 1px solid #FFF;
    font-size: 8pt;
    padding: 4px;
}
table.tablesorter thead tr .header {
    background-image: url(bg.gif);
    background-repeat: no-repeat;
    background-position: center right;
    cursor: pointer;
}
table.tablesorter tbody td {
    color: #3D3D3D;
    padding: 4px;
    background-color: #FFF;
    vertical-align: top;
}
table.tablesorter tbody tr.odd td {
    background-color:#F0F0F6;
}
table.tablesorter thead tr .headerSortUp {
    background-image: url(asc.gif);
}
table.tablesorter thead tr .headerSortDown {
    background-image: url(desc.gif);
}
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
background-color: #5B5781;
}
Run Code Online (Sandbox Code Playgroud)

这是我用来更改行的 jquery css(它是 $.post() 调用的回调):

function(){
            $("#row_"+id).css("background-color", "orange");
            }
Run Code Online (Sandbox Code Playgroud)

kei*_*kei 5

TR 具有背景颜色没有任何问题。

您的代码有效,但您必须意识到您指定 TD 的背景颜色为 #FFF。您正在更改 TR 的 BG 颜色,但 TD 的颜色在其之上。