bgColor
cellPadding
cellSpacing
大小写

解决方案 »

  1.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 2</title>
    </head><body>
    <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#a5c2e0 border=0>
    <TBODY>
    <TR>
    <TD id=container width="100%"> 
    <TABLE id=_t height="50" width=200 border=1 bgcolor="red" cellPadding="0" cellSpacing="0">
    <TBODY>
    <TR>
    <TD>&nbsp;</TD>
    <TD>&nbsp;</TD>
    <TD>&nbsp;</TD>
    <TD>&nbsp;</TD>
    <TD>&nbsp;</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></body></html>
      

  2.   

    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>DOM</title>
    </head><body>
      <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#A5C2E0">
        <tr>
          <td id="container" width="100%"></td>
        </tr>
      </table>
    <script language="javascript">
    var table=document.createElement("TABLE");
    var tbody=document.createElement("TBODY");
    var tr=document.createElement("TR");
    var td1=document.createElement("TD");
    td1.innerText =" ";
    tr.appendChild(td1);

    var td2=td1.cloneNode(false);
    td2.innerText =" ";
    tr.appendChild(td2);

    var td3=td1.cloneNode(false);
    td3.innerText =" ";
    tr.appendChild(td3);

    var td4=td1.cloneNode(false);
    td4.innerText =" ";
    tr.appendChild(td4);

    var td5=td1.cloneNode(false);
    td5.innerText =" ";
    tr.appendChild(td5);
    tbody.appendChild(tr);
    table.appendChild(tbody);

    table.setAttribute("id","_t");
    table.setAttribute("border","1");
    table.setAttribute("bgColor","red");
    table.setAttribute("width","200");
    table.setAttribute("height","50");
    table.setAttribute("cellPadding","0");
    table.setAttribute("cellSpacing","0");

    container.appendChild(table);
    </script>
    <hr>
    <TEXTAREA NAME="out" ROWS="10" COLS="80" ondbclick="this.value=window.document.body.innerHTML"></TEXTAREA>
    </body></html>