var table = document.getElementById("table_name"); var rows = table.rows.length;//行数 var cells = table.rows.item(0).cells.length;//列数