I have a table with three columns, the first column contains the name of the service, which is a hyperlink, the second column contains a status icon, and the last column again is the image for the log file, which is again a hyperlink.
I want to sort by the first column, which is a hyperlink, so sorting should be done by the text of the hyperlink, as well as by the second column, which is a status icon based on the balance of state below:
<table border="0" cellspacing="0" cellpadding="3" class="services" width=100%> <thead> <tr> <th align="left">Service Name</th> <th align="left">Status</th> <th align="left">Log</th> </thead> <tbody> <tr> <td><a href="">Service 1</a></td> <td><img srd="running.png" /></td> <td><a href=""><img src="log.png" />Log1</a></td> </tr> <tr> <td><a href="">Service 2</a></td> <td><img srd="error.png" /></td> <td><a href=""><img src="log.png" />Log</a></td> </tr> <tr> <td><a href="">Service 3</a></td> <td><img srd="stopped.png" /></td> <td><a href=""><img src="log.png" />Log</a></td> </tr> </tbody> </table>
Now I want to sort the first and second columns, which are the service name and status, respectively. Since the first column contains the link and the second image, I want to sort them.
The code I'm using is below, which doesn't seem to work.
jQuery(document).ready(function() { jQuery(".services").tablesorter({
Any help would be greatly appreciated. NOTE. I want to sort the status by their states, for example, the status with their weight below:
running =>1 stopped =>2 error =>3
source share