sebas
sebas

Reputation: 742

Jquery: push a given set of "tr" inside a table to the very top of that table

I can't finish this Jquery script.

http://jsfiddle.net/8UDxU/

Right now what its doing is grabbing every "td" that contains an img src and a certain text and apply a css yellow background.

What i want to add to that jquery script (and i cant figure it out) is make em go to the very top of that table.

So a result all those yellow tr's would be at the very top of the table always.

Anyone can help me on this one?

Upvotes: 0

Views: 143

Answers (1)

matdumsa
matdumsa

Reputation: 16105

prependTo might do the trick

$('#SubscribersManageList tr:contains("$"):not(:has(img[src="images/plus.gif"]))').css("background-color", "yellow").prependTo("#SubscribersManageList tbody");

http://jsfiddle.net/h6qcX/ http://api.jquery.com/prependTo/

Upvotes: 2

Related Questions