好像不行,从后台直接输入HTML代码吧

解决方案 »

  1.   

    关注
    不过我觉得你用RepeatList可以完成你想要的结果
      

  2.   

    可以的,以前在MSDN上面看过一篇文章,也是为了一个功能而要把表头和表体区分开来,下面的代码是那篇文章的思路:protected override void Render(HtmlTextWriter writer)
    {
    StringWriter sw = new StringWriter();
    HtmlTextWriter tempWriter = new HtmlTextWriter(sw);
    this.RenderControl(tempWriter); String strCtrl = tempWriter.ToString(); int iStart = strCtrl.IndexOf("<tr>");
    if (iStart != -1)
    {
    strCtrl.Insert(iStart, "<thead>");
    } iStart = strCtrl.IndexOf("</tr>");
    if (iStart != -1)
    {
    strCtrl.Insert(iStart + 5, "</thead>");
    } writer.Write(strCtrl);
    }