2011-05-16 52 views
3

我使用的是tablesorter 2.0,我一直試圖重載css主題,當點擊一個按鈕,但我似乎無法得到任何東西。我試圖給主題文件添加一點CSS,但我認爲另一個屬性重寫它。我想要做的是更改某一類某一排的背景顏色。Tablesorter主題,改變點擊按鈕上的行背景

如果任何人都可以檢查出來並告訴我將類和屬性添加到這個文件的位置,這將不勝感激。

這裏是的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; 
} 

這裏是jQuery的CSS我用它來改變行(這是從$。員額()調用回調):

function(){ 
      $("#row_"+id).css("background-color", "orange"); 
      } 

回答

4

有背景色的TR沒有錯。

您的代碼有效,但您必須認識到您指定TD具有#FFF的背景顏色。你正在改變TR的BG顏色,但TD的顏色是最重要的。

+0

完美。謝謝你指出! – 2011-05-16 19:22:24