First thought: $("table td").each( function () { var nr = parseFloat($(this).text()); if (nr > 1.5)
}); On 2/16/07, rolfsf <[EMAIL PROTECTED]> wrote: > > Is there a clever way in jQuery to find non-zero data in specific columns of > a table, and assign them a class based on whether they are positive or > negative? In plain English, I want to make positive numbers green (or the > cell bg) and the negative numbers red, but only in certain columns. Ideally, > I would want to fine tune the range - say, > 1.5 is green and < -1.5 is red. > I suspect that COL and COLGROUP are not very useful as selectors. > > Thanks! > -- > View this message in context: > http://www.nabble.com/adding-a-class-to-positive-and-negative-data-cells-in-a-table-column-tf3240521.html#a9007930 > Sent from the JQuery mailing list archive at Nabble.com. > > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > -- —————————————— Med Vänliga Hälsningar Kristinn "Kiddi" Sigmundsson 0707-971938 —————————————— _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/