parsmizban
Member
سلام من مي خوام به صورت ديناميك به جدول row اضافه كنم
چه جوري ميشه؟
چه جوري ميشه؟
<TABLE Width=100>
<?PHP
FOR(intCounter = 1;intCounter <= 10;intCounter++)
{
PRINT("<TR>");
PRINT("<TD>Row</TD>");
PRINT("</TR>");
}
?>
</TABLE>
خوب، بستگی داره که این row های جدید از کجا بیاننیازی به ایجکس نداره
<html>
<head>
<script>
function addRow()
{
var newRow = document.createElement("<tr>");
var newCol = document.createElement("<td>");
var innerText = document.createTextNode("A new row");
newCol.appendChild(innerText);
newRow.appendChild(newCol);
document.getElementById('table1').appendChild(newRow);
}
</script>
</head>
<body>
<table width=100 bgcolor="red" id="table1">
<tr>
<td>Existing Row</td>
</tr>
</table>
<br>
<input type="button" onclick="addRow();" value="Add Row">
</body>
</html>