I\'m trying to build a HTML table using an ASP repeater:
I think the core problem is that Repeater
isn't designed to repeat horizontally.
Maybe you should try using DataList which allows to specify the RepeatingDirection.
Update
If you don't need to repeat horizontally (like your question suggests "...two lines and X columns") your Repeater
should look like this
<asp:Repeater ID="RepeaterVersionsForPie" runat="server">
<HeaderTemplate>
<table id="VersionsTable">
</HeaderTemplate>
<ItemTemplate>
<tr>
<th><%# Eval("nameVersion") %></th>
<!-- Important: Put attributes in single quotes so they don't get
mixed up with your #Eval("xxx") double quotes! -->
<td tag='<%#Eval("idVersion")%>'>
<%# Eval("DocumentName") %>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Note that you must not repeat the <table>
in your <ItemTemplate>
and to use single quotes when you need to put your Eval
inside an attribute.