<table width="800" border="0">
<tr>
<td align="center"><font color="#006600" size="2"><b>Row (จำนวน แถว)</b></font></td><td> <input type="text" id="row_tb" name="row_tb" />
<input type="button" name="Button" value="Insert Record" onclick="loop_insert()" /></td>
</tr>
</table>
<div class="roundedcornr_box_168289">
<div class="roundedcornr_top_168289"></div>
<div class="roundedcornr_content_168289">
<br> <p>
<table width="800" border="1" id="myTable">
<tr>
<th width="50"><font color="#006600">No.</font></th>
<th><font color="#006600">Description.</font></th>
<th><font color="#006600">Supplier Name.</font></th>
<th><font color="#006600">Size.</font></th>
<th><font color="#006600">Quantity.</font></th>
<th><font color="#006600">Prize.</font></th>
<th><font color="#006600">Source.</font></th>
</tr>
<script>
function loop_insert(){
var num=document.getElementById('row_tb').value
for(i=1;i<=num;i++){
insert_row()
}
}
function insert_row(){
var myTable=document.getElementById('myTable')
var current_row=document.getElementById('myTable').rows.length
var x=myTable.insertRow(current_row) // insert new row
var y=myTable.rows // get attribute of row
var a=x.insertCell(0) // assign position of cell 1 in new row
var b=x.insertCell(1) // assign position of cell 2 in new row
var c=x.insertCell(2) // assign position of cell 3 in new row
var d=x.insertCell(3) // assign position of cell 4 in new row
var f=x.insertCell(4) // assign position of cell 5 in new row
var e=x.insertCell(5) // assign position of cell 6 in new row
var g=x.insertCell(6) // assign position of cell 7 in new row
a.innerHTML=current_row
var numrow=(a.innerHTML=current_row);
b.innerHTML="<input type='text' name='Description[]' size='40' id='Description[]' />"
c.innerHTML="<input type='text' name='Supplier_name[]' size='40' id='Supplier_name[]' />"
d.innerHTML="<input type='text' name='Size[]' size='3' id='Size[]' />"
f.innerHTML="<input type='text' name='Quantity[]' size='6' id='Quantity[]' />"
e.innerHTML="<input type='text' name='Prize[]' size='3' id='Prize[]' />"
g.innerHTML="<input type='text' name='Source[]' id='Source[]' />"
}
</script>
</table>