for (var i=1; i<n; i++)
document.getElementById("ProductLineIn").innerHTML="<td>&nbsp; </td>"

解决方案 »

  1.   

    不好意思,少了个 + .document.getElementById("ProductLineIn").innerHTML += " <td>&nbsp; </td>"
      

  2.   

    function insCell()
      {
      var x=document.getElementById('ProductLineIn').insertCell(0)
      x.innerHTML="添加的td"
      }
      

  3.   

    <html> 
    <head> 
    </head> 
    <body> 
     <table width="100%" border="1" border="1"bordercolorlight='#000000' bordercolordark='#ffffff'  id="ProducLine"> 
              <tr id="ProductLineIn"> 
                <td>&nbsp; </td> 
                <td>&nbsp; </td> 
                <td>&nbsp; </td> 
              </tr> 
            </table> 
    <script>
    var x=document.getElementById('ProductLineIn').insertCell(3)
      x.innerHTML="添加的td"</script></body> 
    </html> 
      

  4.   

    一直在第三个位置插入<td>,能否在末端插入<td>?也就是说,每次插入<td>都在末尾.
      

  5.   

    不是的 var x=document.getElementById('ProductLineIn').insertCell(3) 
    x.innerHTML="添加的td" insertCell(3) 后面的参数就是插在第几列之后