开发者

Tablesorter, Color rows depending on an specific value

I've been looking around for a solution to this thing but I haven't found anything similar to what I want.

I've got a table filled with data from a database, and I want to change the background colour of a specific row depending on the clas开发者_开发问答s I'm loading in each row.

I have to display some data but as the fields to be displayed are quite a lot, I don't have more space to show a status field, so I would like to show the row in red if the status is inactive, and the rest of the rows in the normal color of the blue stylesheet.

Is there a way to do that through tablesorter? I'm open to suggestions, as I'm not sure of how I want to do it.

Thank you all in advance,

Victor


<style>
      table.even, tr.active td
       {
         background-color:#00F; //BLUE IF ACTIVE
         height:40px;
       }

       table.even, tr.inactive td
       {
         background-color: #F00;//RED IF INACTIVE
         height:40px;
       }
</style>


<table>
    <tr class= (put condition which returns true if active otherwise false)?   "active" : "inactive">


    </tr>
<table>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜