$(document).ready(function () {
    var rowCount = parseInt($("#rowCount").val());
    var cellCount = parseInt($("#cellCount").val())+1;
    CreateTable(rowCount, cellCount);

});

//jyl 创建表
function CreateTable(rowCount, cellCount) {
    var table = $("<table border=\"1\">");
    table.appendTo($("#lpbTable"));
    for (var i = 0; i < rowCount; i++) {
        //行id
        var rowid = rowCount - i;
        var tr = $("<tr id=" + rowid + "></tr>");
        tr.appendTo(table);
        for (var j = 0; j < cellCount; j++) {
            //列id
            var cellid = j+"";
            var tdid = rowid + "_" + cellid;
            var td = $("<td id=" + tdid + ">" + tdid + "</td>");
            td.appendTo(tr);
        }
    }
    $("#lpbTable").append("</table>");
}