<html>
<head>
<title>学生管理页面</title>
<link rel="stylesheet" type="text/css" href="./css/table.css"/>
<script>
function addinfo(){
var result=showModalDialog("addStudent.html",'','dialogwidth:650px;dialogheight:300px' );
alert(result);
addrow(result)

} function addrow(result){
//alert( result );
var mytable = document.createElement("table");
var tb = document.createElement("tbody");
var tr = document.createElement("tr");

for(i=0;i<result.length;i++){
var td = document.createElement("td");
td.innerHTML=result[i];
tr.appendChild(td);
}

tb.appendChild(tr);
mytable.appendChild(tb);
}
</script>
</head>
<body bgcolor="&abcdef" >
<center>
<table id="maTable" border="2">
<caption>学生管理</caption>
<tr colspan="4">
<td><input id="add" type="button" value="添加" onclick="addinfo()">
<input id="remove" type="button" value="删除"></td>
</tr>
<tr>
<th>学生</th>
<th>年龄</th>
<th>性别</th>
<th>学校</th>
</tr>

</table>
</center>
</body>
</html>
<html>
<head>
<title>添加学生信息</title>
<link rel="stylesheet" type="text/css" href="./css/table.css"/>
<script>
function add(){

var stu=[];
stu[1] = document.getElementById("username").value;
stu[2] = document.getElementById("userage").value;
stu[3] = document.getElementById("usersex").value;
stu[4] = document.getElementById("userschool").value;
returnValue=stu;
alert(stu);
window.close();
}
</script>
</head>
<body>
<center>
<table>
<caption>添加学生信息</caption>
<tr>
<td>姓名:</td>
<td><input id="username" size="13"/></td>
</tr>
<tr>
<td>年龄:</td>
<td><input id="userage" size="13"/></td>
</tr>
<tr>
<td>性别:</td>
<td><input id="usersex" size="13"/></td>
</tr>
<tr>
<td>学校:</td>
<td><input id="userschool" size="13"/></td>
</tr>
<tr>
<td>操作:</td>
<td><input type="button" id="button" value="确认" onclick="add()"/></td>
</tr>
</table>
</center>
</body>
</html>