html - How to modify layout using an Asp.net Repeater -
i have table in db has 2 columns "car" & "color".
in asp.net application, have repeater within table. repeater looks this:
<asp:repeater id="repeater_carscolors" runat="server"> <itemtemplate> <tr> <td> <asp:label id="lbl_car" runat="server" text='<%#bind("car")%>'/> <asp:label id="lbl_color" runat="server" text='<%#bind("color")%>'/> </td> </tr> </itemtemplate> </asp:repeater> right now, displaying results such:

how can modify repeater that, instead of having 1 item per row, can have multiple ones such:

thanks.
found solution on thread.
<table> <asp:repeater id="rpttest" runat="server"> <itemtemplate> <%# (container.itemindex + 4) % 4 == 0 ? "<tr>" : string.empty %> <td> ... cell contents omitted ... </td> <%# (container.itemindex + 4) % 4 == 3 ? "</tr>" : string.empty %> </itemtemplate> </asp:repeater> </table> credit original poster.
cheers!
Comments
Post a Comment