구 글 브 라 우 저 insert Cell 과 appendChild 의 차이
1869 단어 구 글 브 라 우 저insertCellappendChild
<html>
<script type="text/javascript"><!--
function generatable(){
var tableObje = document.getElementById("info");
var bodyObj = tableObje.tBodies[0];
var rowObj = bodyObj.insertRow();
var cellObj = rowObj.insertCell();
cellObj.innerHTML = " ";
cellObj = rowObj.insertCell();
cellObj.innerHTML = " ";
cellObj = rowObj.insertCell();
cellObj.innerHTML = " 。";
}
function generatable1(){
var tableObje = document.getElementById("info");
var bodyObj = tableObje.tBodies[0];
var rowObj = document.createElement("tr");
var cellObj = document.createElement("td");
cellObj.innerHTML = " ";
rowObj.appendChild(cellObj)
cellObj = document.createElement("td");
cellObj.innerHTML = " ";
rowObj.appendChild(cellObj);
cellObj = document.createElement("td");
cellObj.innerHTML = " 。";
rowObj.appendChild(cellObj);
bodyObj.appendChild(rowObj);
}
// --></script>
<body onload="generatable()">
<table width=100 bgcolor=#f3f3f3 id=info border=1 style="table-layout:fixed;" style="table-layout:fixed;">
<thead>
<tr>
<td style="width:80"> </td>
<td style="width:200"> </td>
<td style="width:100"> </td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</body>
</html>