SQL query in tables side by side instead of one long table
I have ajax ReorderList in my wep page,and I get the data from SQL Server. I would like to add table cells dynamically according to number of records 开发者_运维知识库and show the result side by side until for example I have five data in a row and then move to the next row,
any idea?
Thanks in advance
Use a DataList control, and set the Horizontal layout to the desired number of cells using the RepeatColumns and RepeatDirection properties.
<asp:DataList id="myDataList" runat="server"
RepeatColumns="5" RepeatDirection ="Horizontal"
DataSourceID="MySqlDataSource" DataKeyField="SqlKeyFieldName">
<ItemTemplate>
<%# Eval("SqlFieldName") %>
</ItemTemplate>
</asp:DataList>
精彩评论