87,997
社区成员




<html>
<head>
<script type="text/javascript">
function cell() {
var x = document.getElementById('myTable').rows.length;
var x = document.getElementById('myTable').insertRow(x - 1)
var y = x.insertCell(0)
var z = x.insertCell(1)
y.innerHTML = "NEW CELL1"
z.innerHTML = "NEW CELL2"
}
</script>
</head>
<body>
<table id="myTable" border="1">
<tr>
<td>cell 1</td>
<td>cell 2</td>
</tr>
<tr>
<td>cell3</td>
<td>cell4</td>
</tr>
</table>
<br />
<input type="button" onclick="cell()" value="Alert first cell">
</body>
</html>