普通的只会tr,td那种呢。哎。
可以的啊,直接生成就可以了,自己拼一下js,不就ok了?
参考:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<style>
</style>
</head>
<body>
行:<input type="text" id="rowsinput" />
列:<input type="text" id="colsinput" />
<input type="button" id="generatortable" value="生成" />
<div id="tablesin">
</div>
</body>
</html>
<script>
$(document).ready(function(){
$("#generatortable").click(function(){
var rows = $("#rowsinput").val();
var cols = $("#colsinput").val();
var tableshtml = "<table>";
var trhtmls = "";
for (var i = rows; i > 0; i--) {//遍历行.
trhtmls += "<tr>"
for (var j = cols; j > 0; j--) {//遍历列.
trhtmls+="<td>"+j+"</td>";
}
trhtmls+="</tr>";
};
tableshtml+= trhtmls+"</table>";
$("#tablesin").html(tableshtml);
})
})
</script>
有会的吗
f 不会 。