1

I have asp repeater which looks like this

<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 table layout like this?

enter image description here

0

2 Answers 2

1

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>
Sign up to request clarification or add additional context in comments.

Comments

1

A Repeater is a for-loop like structure for rendering markup.

You can accomplish what you're trying to do by using a nested repeater: Outside repeater for <tr>'s and wrap your <td>'s in another repeater.

You can also accomplish this by using asp:DataList control, which is a more elegant solution to what you're trying to do.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.