I have an asp repeater that looks like
<asp:Repeater runat="server" ID="Repeater1"> <HeaderTemplate> <table border="1"> </HeaderTemplate> <ItemTemplate> <tr> <td> <%# Eval("Username")%> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater>
How can I make a table this way?
Try Listview
http://weblogs.asp.net/scottgu/archive/2007/08/10/the-asp-listview-control-part-1-building-a-product-listing-page-with-clean-css-ui. aspx
<asp:ListView ID="ContactsListView" DataSourceID="ContactsDataSource" GroupItemCount="2" runat="server"> <ItemTemplate> <%# Eval("Username")%> </ItemTemplate> </asp:ListView>
A Repeateris a loop-like structure for rendering markup.
Repeater
You can accomplish what you are trying to do using a nested repeater: an external repeater for <tr>and wrap yours <td>in another repeater.
<tr>
<td>
, asp:DataList, , .
asp:DataList