Data List repeating column background img
Hi,
I have a datalist that has two repeating columns.
I need to have both columns in just one table as I am using a background image for the table and need it to span across both columns.
So I need something like this (psuedo ish code):
Code:
<asp:DataList id="DataList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="1" RepeatLayout="Table"
OnItemDataBound="DataList1_OnItemDataBound" Width="780px">
<ItemTemplate>
<table border=1 height="192px" width="780px" class="galleryslash" cellpadding="5">
<tr>
<td><%# DataBinder.Eval(Container.DataItem, "title1") %><!--first record--></td>
<td><%# DataBinder.Eval(Container.DataItem, "title2") %><!--next record--></td>
</tr>
<table>
</ItemTemplate>
So the end result would look something like this:
html example
Any ideas how I can achieve this?
Thanks
F
Re: Data List repeating column background img
I think I've managed to hack it to get what I need. Basically by splitting the table between the item template and alternating item template:
Code:
<asp:DataList id="DataList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="2" RepeatLayout="Table"
OnItemDataBound="DataList1_OnItemDataBound" Width="780px">
<ItemTemplate>
<table border=0 Width="780px" height="192px" class="gallery">
<tr>
<td>Row 1</td>
</ItemTemplate>
<AlternatingItemTemplate>
<td>Row 2</td>
</tr>
</table>
</AlternatingItemTemplate>
</asp:DataList>
It's a bit dirty but it (so far) seems to do the trick...
Re: Data List repeating column background img
That's pretty much how you would do it with tables.