Сообщение от devote
|
например тег tbody
|
В нём-то всё и дело...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript">
function DataTable(Rows) {
var table = document.getElementById('data');
var k = table.rows.length;
var i, row, td;
for(i = 0; i < k; i++) table.deleteRow(0);
var table = document.getElementById('target');
for(i = 0; i < Rows; i++) {
row = document.createElement("tr");
td = document.createElement("td");
td.innerHTML = i;
row.appendChild(td);
table.appendChild(row);
}
}
</script>
</head>
<body>
<select onchange="DataTable(this.value);">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<table class="data" id="data">
<tbody id='target'></tbody>
</table>
<script language="javascript" type="text/javascript">
DataTable(5);
</script>
</body>
</html>