标签:span nbsp charset row javascrip class apple for 循环
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
</body>
<script type="text/javascript">
//首先设置行,列
var cols = 6; //6列
var rows = 6; //6行
var htmlstr = "<table border=‘1px‘>";
for(i = 1; i <= rows; i++) {
htmlstr += "<tr>";
for(j = 1; j <= cols; j++) {
htmlstr += "<td >" + i + "行" + j + "列" + "</td>";
}
htmlstr += "</tr>";
}
htmlstr += "</table>";
document.write(htmlstr);
</script>
</html>
标签:span nbsp charset row javascrip class apple for 循环
原文地址:http://www.cnblogs.com/niuniudashijie/p/5988085.html