Searching single table column with jQuery

In Codeigniter 1.7.2 there is no way to change the style of an individual cell with the Table class, this is not good and everyone is much looking forward to 2.0 where this sort of magic is apparently going to be included (go to this page and search for “individual cells”). So, say you have a table that contains specific values in some cells that need extra attention – if the table contains no colspan or rowspan then you’re emphatically in luck and can do the following trick with jQuery without custom id tagging of your content:

$('td:nth-child(10)').each(function () { // search 'Deposit'
content = $(this).text();
if (content.indexOf("No") != -1) {
} else if (content.indexOf("Waiting") != -1) {
} else if (content.indexOf("Yes") != -1) {

That will select the 10th column and search it for specific value and change the container cells depending thereupon, result can be seen in screenshot. Ah yes. Side-note: of course you would need to wrap your jQuery code in the pre-requisite $(document).ready(function() and so forth (Google is our mutual friend).

Resources used in connection to above snippet: