两个问题各30分钟
1.如是设置表格中的一个空行高度为0,要看不见高度的,就像没有一样.
2. <tr> <td> </td> </tr> ,如果在后面追加html代码,比如再加一行
<tr> <td> </td> </tr>
<tr> <td> </td> </tr> ,
------解决方案--------------------先说第二个:
<TABLE border=1 width= "100% " id= "Table ">
<TR>
<TD> </TD>
<TD> </TD>
</TR>
</TABLE>
<INPUT TYPE= "button " value= "添加 " onclick= "add_row(); ">
<SCRIPT LANGUAGE= "JavaScript ">
function add_row()
{
oRow = Table.insertRow();
oCell = oRow.insertCell();
oCell.innerHTML = "1 ";
oCell = oRow.insertCell();
oCell.innerHTML = "2 ";
}
</SCRIPT>
------解决方案--------------------2、在添加一行可以参考下面例子
<table id= "table1 ">
<tr id= "tr1 ">
<td> asas1
</td>
</tr>
<tr id= "tr2 ">
<td> asas2
</td>
</tr>
<tr id= "tr3 ">
<td> asas3
</td>
</tr>
</table>
<script language=javascript>
document.getElementById( "table1 ").childNodes[0].appendChild(document.getElementById( "tr1 ").cloneNode(true))
</script>