使用Style.Add("background-color","transparent")这种方式增加style到你需要的地方。这种问题查一下msdn不是都有了呀。

解决方案 »

  1.   

    记得是xx控件.Style.Add("background-color","transparent")
    如果你要单元格的话TableCell cell2=new TableCell();
    cell2.Style.Add("background-color","transparent")
      

  2.   

    我想你们没有理解我的意思
    我是说,我的Table控件已经设置好了,比如就有4个单元格,
    还有就是让他具有象button控件那样具有单击属相,当单击单元格1是,让其变色!
    请问这有没有办法实现!
      

  3.   

    <td id="**" runat=server></td>
    后台随你改
      

  4.   

    Table tb=new Table();
    TableRow tr;
    TableCell tc;
    for(int i=0;i<5;i++)
    {
    tr=new TableRow();
    for(int j=0;j<5;j++)
    {
    tc=new TableCell();
    tc.Attributes.Add("onclick","this.bgColor='#ff0000'");
    tc.Text="hgknight";
    tr.Cells.Add(tc);
    }
    tb.Rows.Add(tr);
    }
    this.Controls[1].Controls.Add(tb);