<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
?<script type="text/javascript" src="js/selectrole.js"></script>
? <script type="text/javascript" src="js/signin.js"></script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
? <table width="292" height="62" border="1">
??? <tr>
????? <td width="53">編號</td>
????? <td width="223"><label>
??????? <input type="text" name="textfield" />
????? </label></td>
??? </tr>
??? <tr>
????? <td>姓名</td>
????? <td><label>
??????? <input type="text" name="textfield2" />
????? </label></td>
??? </tr>
??? <tr>
????? <td>登錄名</td>
????? <td><label>
??????? <input type="text" name="textfield3" />
????? </label></td>
??? </tr>
?? ???? <tr>
????? <td>身份</td>
????? <td><label>
??????? <input type="text" name="role" />
??????? <input type="button" name="Submit2" value="..." onclick="openwindow();" />
????? </label></td>
??? </tr>
? </table>
? <input type="button" name="Submit" value="保存" onclick="savesignin();" />
</form>
<table id="signin" width="445" border="1">
? <tr>
??? <th width="68" scope="col">編號</th>
??? <th width="42" scope="col">姓名</th>
??? <th width="67" scope="col">登錄名</th>
??? <th width="49" scope="col">身份</th>
??? <th width="85" scope="col">創建時間</th>
??? <th width="94" scope="col">登錄時間</th>
? </tr>
</table>
<p> </p>
</body>
</html>
// JavaScript Document
function savesignin(){
//添加一行
var newTr = document.getElementById("signin").insertRow(-1);
//添加兩列
var newTd0 = newTr.insertCell(-1);
var newTd1 = newTr.insertCell(-1);
var newTd2 = newTr.insertCell(-1);
var newTd3 = newTr.insertCell(-1);
var newTd4 = newTr.insertCell(-1);
var newTd5 = newTr.insertCell(-1);
//設置列內容和屬性
newTd0.innerHTML = '測試';
newTd1.innerHTML= '新加行';
newTd2.innerHTML = '測試';
newTd3.innerHTML= '新加行';
newTd4.innerHTML = '測試';
newTd5.innerHTML= '新加行';
}