jQuery获取表格总行数汇总

var rowCount = $('#myTable tr').length;


var rowCount = $('#myTable >tbody >tr').length;


$("#myTable").attr('rows').length;


var rowCount = $('table#myTable:last').index() + 1;


//Helper function that gets a count of all the rows <TR> in a table body <TBODY>
$.fn.rowCount = function() {
    return $('tr', $(this).find('tbody')).length;
};

// USAGE:

var rowCount = $('#productTypesTable').rowCount();


alert(jQuery("#jtkList").find("table").eq(0).find("tr").length);

你可能感兴趣的:(jquery,table,rows)