Javascript
var table_list;
function addRow()
{
a = table_list.insertRow(1);
a.insertCell(0).innerHTML="happy";
a.insertCell(1).innerHTML="happy";
a.insertCell(2).innerHTML="happy";
a.insertCell(3).innerHTML="happy";
}
function init()
{
table_list = document.getElementById("table");
}
HTML
<table id="table">
<thead>
<tr>
<th>Address</th>
<th>Protocol</th>
<th>Start</th>
<th>End</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
Reference:
TableRow insertCell() Method
0 意見:
張貼留言