当前位置: 代码迷 >> Web前端 >> jQuery获取报表总行数汇总
  详细解决方案

jQuery获取报表总行数汇总

热度:81   发布时间:2012-11-23 00:03:43.0
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);
  相关解决方案