“A剧团”在“2005-08-20”之上,“B剧团”在“2005-08-30”之上,“C剧团”在“2005-09-05”之上,排版错位。

解决方案 »

  1.   

    用Table当然可以,该怎么实现呢?
      

  2.   

    楼主是不是想实现交叉列表的功能啊?
    不固定列的话AutoGenerateColumns=true
    在生成的Table里面给字段设定好别名
      

  3.   

    To:fengjianwei1982(小熊) 我想实现的就是交叉列表功能。
      

  4.   

    我给个思路吧
    先把读出的数据放到DataTable里面,然后用两个foreach嵌套读出行数和列数,第一个读行,第二个读列,在第二个foreach里面放构造Table的代码,这样应该没问题了。
    给一段构造表格的代码你,你修改一下就行了:
    void CTable(string BName,string Unit,string Price){
    HtmlTableRow rw;
    HtmlTableCell cl;
    rw = new HtmlTableRow();
    cl=new HtmlTableCell();
    cl.InnerHtml=BName;
    rw.Cells.Add(cl);
    cl=new HtmlTableCell();
    cl.InnerHtml=Unit;
    rw.Cells.Add(cl);
    cl=new HtmlTableCell();
    cl.InnerHtml=Price;
    rw.Cells.Add(cl);
    Table1.Rows.Add(rw);
    }
      

  5.   

    用stringBuilder来动态生成Html吧,然后循环输出到<td runat=server id="td+ID">中