finding nested table cell contents - jquery query performance -
i have huge table generated html in each td. generated html table inside container div of class .cellcontent
. current jquery getting contents of first cell of table slow. what better/faster way of writing following?
var contents = $(cell).find('.cellcontent>table>tbody>tr>td:first :first-child');
this jquery executed each cell in large table quite , appears significant performance drain on page.
cell following:
var maintable = document.getelementbyid("gridid"); (var colindex = startindex; colindex <= maintable.rows[0].cells.length; colindex++) { (var = 1, row; row = maintable.rows[i]; i++) { cell = row.cells[colindex - 1]; } }
the exact generated html of cell contents along lines of following:
<td class="staticcol prefitem"> <div class="p_5_18_2013 cellcontent"> <table> <tbody> <tr> <td> <!-- ***html want*** e.g., div or p or other markup --> </td> </tr> </tbody> </table> </div> </td>
give elements class name. when generating content. can directly target them.
var contents = $('.classname', cell);
Comments
Post a Comment