本帖最后由 ba21 于 2017-7-6 13:03 编辑
语法错语,请看下面代码:
<html>
<head>
<title>风雪论坛</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
window.onload=function()
{
var list = document.getElementById("ZhuYe");
var aListText = ["Python","C","C++","信息安全","web","Linux","汇编语言","密码学","java"];
var sListText = "<table><tr>";
for (var o = 0;o < aListText.length;o++)
{
if (o % 3 == 0 & o != 0)
{
if (o != 9)
{
sListText +="</tr><tr>";
}
else
{
sListText +="</tr>";
}
}
sListText += "<td>"+aListText[o]+"</td>";
}
list.innerHTML = sListText;
}
</script>
</head>
<body id="ZhuYe">
</body>
</html>
|