This (I think), is a little complicated. I have a table being created from an AJAX response.
I have a working example of what I’m doing here at : http://jsfiddle.net/Qy6DN/
I have the table column names in the thead. The tbody itself is inserted after an ajax response. Now, what I need is the number of rows in the tbody, the total of values in each column, the total of values in each row, and a grand total – all this information will be in the tfoot. I’ve managed to work out the formula required (as you can see if you click the ‘calculate’ button) .What I’m looking for is something which will be, hopefully, shorter, more efficient so that I can learn shorter jQuery selectors.
Well jQuery falls back onto pseudo-selectors as a convenience feature. The most efficient way would be to use the native JavaScript DOM API.
I have edited your fiddle – http://jsfiddle.net/Qy6DN/2/ to use the native API.