Within a page I implemented a repeater, like this:

<asp:Repeater ID = "rptDetails" runat = "server" OnItemDataBound = "rptDetails_ItemDataBound" >
    <HeaderTemplate>
    </HeaderTemplate>

    <ItemTemplate>
        <div class="row" style="margin-top: 10px; margin-left: 5px;">
            <div class="col-5"><strong>Name:</strong>&nbsp;<asp:Literal ID="litName" runat="server" /></div>
        </div>

        <div class="row">
            <div class="col-1" style='margin-top: 10px; margin-left: 5px;'><strong>Address:</strong></div>
            <div class="col-4" style='margin-top: 10px; margin-left: 5px;'><asp:Literal ID="litStreet" runat="server" /></div>
        </div>
        <hr />
    </ItemTemplate>
    <FooterTemplate></FooterTemplate>
</asp:Repeater>

The idea being the to avoid the usage of a table structure. But when I run the code I get a slightly different output:

Name: Some dude

Address:

Some street 902 ABC DEF


The data is shown, but instead of putting it in a somewhat tabular format, it gets printed on separate lines.

In other words I'm expecting the following output:

Name: Some dude

Address: Some street 902 ABC DEF


How do I fix this?

0 Answers