不要对表格使用innerHTML,请使用insertRow,insertCell等
详细介绍和例子参见http://msdn.microsoft.com/workshop/author/tables/buildtables.asp
http://www.cnblogs.com/waxdoll/archive/2005/04/18/140049.html
详细介绍和例子参见http://msdn.microsoft.com/workshop/author/tables/buildtables.asp
http://www.cnblogs.com/waxdoll/archive/2005/04/18/140049.html
我是想把TR插入到<span id="ResultSB"> </span>这个里边
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<script>
function onTwiClick(obj){
var con=obj.cells;
var tbody=document.getElementById("result");
tbody.insertRow(0);
tbody.rows[0].style.backgroundColor="#f7f3f7";
for(var i=0;i<con.length;i++){
tbody.rows[0].insertCell(i).innerText=con[i].innerText;
}
}
</script>
</head>
<body bgcolor="#42A6E7">
<form name="" method="post" action="">
<div style="border-style:solid;">
<table cellpadding="0" cellspacing="1">
<tr id='0' ondblclick='onTwiClick(this)' bgcolor='#F7F3F7'>
<td nowrap='nowrap' style=''>10</td>
<td nowrap='nowrap' style='display:block;'>0000000</td>
<td nowrap='nowrap' style='display:block;'>000000000000</td>
</tr>
<tr id='1' ondblclick='onTwiClick(this)' bgcolor='#F7F3F7'>
<td nowrap='nowrap' style=''>11</td>
<td nowrap='nowrap' style='display:block;'>0000000</td>
<td nowrap='nowrap' style='display:block;'>000000000000</td>
</tr>
</table>
</div>
<div style="border-style:solid;">
<table cellpadding="0" cellspacing="1">
<tbody id="result"></tbody>
</table>
</div>
</form>
</body>
</html>
谢谢指教!