public void AddRows(HtmlTable table(表名),DataTable dt(数据源), string i(自增长)) { int j = int.Parse(i); HtmlTableRow tr0 = new HtmlTableRow(); HtmlTableCell tc = new HtmlTableCell(); tc.Attributes.Add("style","font-size:14px;text-align:center;"); tc.Attributes.Add("colspan", "2"); tc.InnerText = dt.Rows[j]["sbmc"].ToString(); HtmlTableCell tc0 = new HtmlTableCell(); tc0.Attributes.Add("contentEditable", "true"); tc0.Attributes.Add("style", "font-size:14px;text-align:center;"); tc0.InnerText = dt.Rows[j]["xh"].ToString(); tc.Attributes.Add("contentEditable", "true"); tc0.Attributes.Add("contentEditable", "true"); tr0.Cells.Add(tc); tr0.Cells.Add(tc0); table.Rows.Insert(1, tr0); table.Attributes.Add("border", "1"); }