根据读取的数据在页面上显示一行一列的table,但如果读取的数据超过2列的话,就自动生成下一行?
比如     a    b   c  d  这里有四列数据
应该变成   a   b
           c   d  这样如果在读取的话,应该跟在 c  d 后面 
就是这样   a    b
           c    d   e   f应该变成   a     b
           c     d
           e     f如此类推    这怎么实现啊  请大虾指教

解决方案 »

  1.   

    就是后台 用html语言实现的
      

  2.   

    用Repeater控件就很容易实现了!
      

  3.   

    <%# (Container.ItemIndex + 1) % 3 == 0 ? "" : "<br/>"%>
      

  4.   

    repeater行不
      <asp:Repeater ID="rpQuestion" runat="server">
            <ItemTemplate>
                <div id="content<%# Container.ItemIndex %>">
                    <%# (Container.ItemIndex + 1) % 2 != 0 ? "<Table><Tr><TD style='text-align: left;width:400px;'>" : ""%>
                    <%# Eval("字段")%>:
                    <%# (Container.ItemIndex + 1) % 2 != 0 ? "</TD><TD style='text-align: left;width:400px;'>" : ""%>
                    <%# (Container.ItemIndex + 1) % 2 == 0 ? "</TD></TR></TABLE><br />" : ""%>
                </div>
            </ItemTemplate>
        </asp:Repeater>