日期:2014-05-18 浏览次数:20427 次
c1.BgColor = "#009900";
------解决方案--------------------
HtmlTable ht = new HtmlTable();
HtmlTableCell tc = new HtmlTableCell();
HtmlTableRow tr = new HtmlTableRow();
tc.InnerHtml = "TableCell";
tc.Style.Add("bgcolor", "#009900");
tc.Style.Add("background-image", "images/a.gif");
tr.Controls.Add(tc);
ht.Rows.Add(tr);
ph.Controls.Add(ht);
------解决方案--------------------
背景图还是色???
HtmlTable ht = new HtmlTable(); HtmlTableRow htr = new HtmlTableRow(); HtmlTableCell htc = new HtmlTableCell(); htc.Width = "200px"; htc.Height = "50px"; htc.InnerText = "alsdjflsdjf"; htc.BgColor = "#ff0000"; htr.Cells.Add(htc); ht.Rows.Add(htr); this.Controls.Add(ht);
------解决方案--------------------
tc.Style.Add("background-color", "#FF0000");
tc.Style.Add("background-image", "images/a.gif");
这样可以的。
------解决方案--------------------