[jQuery] Fast Table Cell Selection
Im trying to manipulate a subset of a table and selecting the elements
with my poorly written jquery is orders of magnitude slower than a
simple direct DOM access of the elements using
for(y;...)
for(x;...)
table.rows[y].cells[x]._do stuff_
I know both the starting and ending row and starting and ending
column, but i cant get that all into a single snappy jQuery selection.
A couple of things ive tried :
// worst performance
for(y;...)
for(x;...)
$("table tr:eq(y) td:eq(x)")._do stuff_
//still bad
$("table tr:lt(endy):gt(starty)").each(function(i) {
if ( startx <= i%table.rows.length <= endx ) _do stuff_
});
I imagine there has to be a way to get all the cells from the rows &
columns my user has selected in a manner that is _nearly_ as efficient
as direct DOM access and let me use all the power of jquery at the
same time.