SOURCE

console 命令行工具 X clear

                    
>
console
function insCell()
  {
  var x=document.getElementById('tr2').insertCell(0)
  x.innerHTML="John"
  }
<table border="1"> 
  <tbody>
   <tr id="tr1"> 
    <th>Firstname</th> 
    <th>Lastname</th> 
   </tr> 
   <tr id="tr2"> 
    <td>Peter</td> 
    <td>Griffin</td> 
   </tr> 
  </tbody>
 </table> 
 <br> 
 <input type="button" onclick="insCell()" value="插入单元">