如题,给定了行、列等参数,如何生成一个表格?
请给思路,有源码最好!
万分感谢!

解决方案 »

  1.   


               HtmlDocument doc = webBrowser1.Document;
               HtmlElement body = doc.GetElementById("bodyId");
               HtmlElement table = doc.CreateElement("table");
               HtmlElement tbody = doc.CreateElement("tbody");
               HtmlElement tr = doc.CreateElement("tr");
               HtmlElement td = doc.CreateElement("td");
               td.InnerText = "aaaaa";
               body.AppendChild(table);
               table.AppendChild(tbody);
               tbody.AppendChild(tr);
               tr.AppendChild(td);
      

  2.   

    我用mshtml接口生成了table、tbody、tr、td元素,可是却没有AppendChild方法
      

  3.   

    不好意思,我重新看了下代码,我用的命名空间是MSXML2
      

  4.   

    我用的命名空间是mshtml,我不知道用mshtml如何在页面上插入一个表格