Edited to show using repeater to make a three column layout
<table>
<asp:Repeater id="OtherProductsRepeater" OnItemCreated="OtherProductsRepeater_ItemCreated" runat="server">
<ItemTemplate>
<asp:PlaceHolder id="row_end" visible="<%# _showRowEnd %>" runat="server">
</tr>
</asp:PlaceHolder>
<asp:PlaceHolder id="row_start" visible="<%# _showRowStart %>" runat="server">
<tr>
</asp:PlaceHolder>
<td>(data)</td>
<td>(data)</td>
<td>(data)</td>
</ItemTemplate>
</asp:Repeater>
</tr> <%-- close final row --%>
</table>
in your code, you need these page level members:
private int _rowCounter = 0;
protected bool _showRowEnd;
protected bool _showRowStart;
and the event handler:
protected void OtherProductsRepeater_ItemCreated(Object Sender, RepeaterItemEventArgs e) {
if (_rowCounter == 0) { // first row
_showRowStart = true;
_showRowEnd = false;
_rowCounter = 1;
}
else if (_rowCounter == 3) {
_showRowStart = true;
_showRowEnd = true;
_rowCounter = 1;
}
else {
_showRowStart = false;
_showRowEnd = false;
_rowCounter += 1;
}
}
Another thought - if you are talking about newspaper-style columns, where the content flows from the bottom of one column to the top of the next, use a DataList control instead of a repeater.