表1:用户表   ID   name  age
   
    1   小明   18
    2   小李   20表2: 成绩表
    ID   UserID  英语   数学   地理   
    1      1     90      75     85
    2      1     91      90     82
    3      1     95      91     86
    4      2     100     82     84
    5      2     98      79     32表2: 运动成绩表    ID   UserID  跳远     跳高      100米   
    1      1     2.1      1.37      10.2
    2      1     2.4      1.24      9.32
    3      2     1.8      1.4       12.3
 
求一个表格用asp.net服务端table   生产表格的源代码
———————————————————————————————————————|
                         学生所有成绩数据统计                                 |
———————————————————————————————————————|
                       |        成绩表        |      运动成绩表               |
———————————————————————————————————————|
 |  ID   |  name | age |  英语 |  数学 |  地理|   跳远  |   跳高 |    100米 
————————————————————————————————————   
 |       |       |     |  90  |  75   |  85   |  2.1   |  1.37   |    10.2
 |       |       |     ———————————————————————————
 |   1   | 小明  |  18 |  91  |  90   |  82   |  2.4   |  1.24   |    9.32
 |       |       |     ———————————————————————————
 |       |       |     |  95  |   91  |   86  |
——————————————————————————————————————
 |       |      |     |  100  |   82  |   84  |   1.8   |  1.4  |      12.3
 |       |      |     |———————————————————————————
 |   2   | 小李 |  20 |  98   |   79  |   32  |
                   ————————————————————————用asp.net服务端table   生产表格的代码

解决方案 »

  1.   

    用GridView合并相同单元格
    http://www.cnblogs.com/mFrog/archive/2008/06/05/1214732.html
      

  2.   

    多表连接会...但是用asp:Table  那个求表这么合并怎么运算
      

  3.   

    在后台代码构造表时,根据条件设置单元格的rowspan就可以了建议,自己在dw通过界面操作一下看看就明白了
      

  4.   

    你先正常绑定到GridView上
    然后按二楼方法合并列
      

  5.   

    Gridview 纵向列合并
    +
    GridView实现多表头合并 
      

  6.   

      Response.Clear();
                    Response.Buffer = true;
                    Response.Charset = "gb2312";  // gb2312、utf-8、ISO8859-1(Latin-1)
                    Response.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(Exceltitle + ".xls", Encoding.UTF8));
                    Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");//设置输出流为简体中文
                    Response.ContentType = "application/msExcel";//设置输出文件类型为excel文件。 
                    Response.Write("<meta http-equiv=Content-Type content=\"text/html; charset=GB2312\">");
                    Response.Write("<style>.yyyy-MM  { mso-number-format:\\yyyy-MM; }</style>");//添加样式只显示年月
                    this.EnableViewState = true;
                    System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-CN", true);
                    System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad);
                    System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
                    tb.RenderControl(oHtmlTextWriter);//将服务器控件的内容输出
                    Response.Write(oStringWriter.ToString());
                    Response.End();