表结构 
姓名            时间                    主题        价格      照片URL  会议分类 张三 2000-01-01 00:00:00.000  张三的会议 1.00    a.jpg    aaa 
李四 2001-01-01 00:00:00.000  李四的会议 2.00    b.jpg    aaa 
王五 2002-01-01 00:00:00.000  王五的会议 3.00    c.jpg    aaa 
赵六 2003-01-01 00:00:00.000  赵六的会议 4.00    d.jpg    aaa  using (DataTable dt = test.GetTable())
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {                    for (int j = 0; j < dt.Columns.Count; j++)
                    {                        row = new TableRow();
                        if (j == 0)
                        {
                            cell = new TableCell();
                            cell.Attributes.Add("rowspan", dt.Columns.Count.ToString());
                            Image img = new Image();
                            img.ImageUrl = "~/meeting/专家.bmp";
                            cell.Controls.Add(img);
                            row.Cells.Add(cell);
                        }
                        cell = new TableCell();
                        cell.Width = (Unit)200;
                        cell.Text = dt.Rows[i][j].ToString();
                        row.Cells.Add(cell);
                        Table1.Rows.Add(row);                    }
                    
                }
            }

解决方案 »

  1.   

    ,不是和lz说了用repeater+数据绑定多好多块。。
      

  2.   

    lz用得是gridview吧?
    用datalist加个分页就可以了
      

  3.   

    楼上的各位,,用datalist我还用发什么愁啊。
    问题是我现在只能用table去做这个东西。。
      

  4.   

    你试试  应该 可以 的 using (DataTable dt = test.GetTable())
                {
                    
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
             if(i%2==0){ 
             row = new TableRow();                    for (int j = 0; j < dt.Columns.Count; j++)
                        {                        
                            if (j == 0)
                            {
                                cell = new TableCell();
                                cell.Attributes.Add("rowspan", dt.Columns.Count.ToString());
                                Image img = new Image();
                                img.ImageUrl = "~/meeting/专家.bmp";
                                cell.Controls.Add(img);
                                row.Cells.Add(cell);
                            }
                            cell = new TableCell();
                            cell.Width = (Unit)200;
                            cell.Text = dt.Rows[i][j].ToString();
                            row.Cells.Add(cell);
                          
                        }
                      }else
                      {                    for (int j = 0; j < dt.Columns.Count; j++)
                        {                        
                            if (j == 0)
                            {
                                cell = new TableCell();
                                cell.Attributes.Add("rowspan", dt.Columns.Count.ToString());
                                Image img = new Image();
                                img.ImageUrl = "~/meeting/专家.bmp";
                                cell.Controls.Add(img);
                                row.Cells.Add(cell);
                            }
                            cell = new TableCell();
                            cell.Width = (Unit)200;
                            cell.Text = dt.Rows[i][j].ToString();
                            row.Cells.Add(cell);
                          
                        }
                         
                     Table1.Rows.Add(row);   
                   }
                    }
                }