A
Alex Greenberg
Hi,
I don't know if I'm doing anything wrong, but I'm trying to list 3
products per line on a page. So for example, if a user searches for
'widget' and he gets 4 results, I would have something like:
w1 w2 w3
w1 info w2 info w3 info
---------- ------------ -----------
w4
w4 info
----------
I'm using a DataList control, with <ItemTemplate> something like:
<table>
<tr><td>name</td></tr>
<tr><td>info</td></tr>
</table>
the problem is that the products are not lining up, for the obvious
reason that the DataList control is putting each product in its own
table. Specifying the height of the table or its rows doesn't help.
Obviously, what I need is a control that can put the names of the
products in the first row, and the info in the second row, then the
second set of products (4-6) in the third and fourth rows, and so on.
I don't know if the repeater can accomplish that. It just doesn't make
sense to use it, since it will only be able to put one item per row
(right?).
Should I just create my own table and iterate through the products,
filling it up as I go? or is there a better solution?
Thanks,
Alex
I don't know if I'm doing anything wrong, but I'm trying to list 3
products per line on a page. So for example, if a user searches for
'widget' and he gets 4 results, I would have something like:
w1 w2 w3
w1 info w2 info w3 info
---------- ------------ -----------
w4
w4 info
----------
I'm using a DataList control, with <ItemTemplate> something like:
<table>
<tr><td>name</td></tr>
<tr><td>info</td></tr>
</table>
the problem is that the products are not lining up, for the obvious
reason that the DataList control is putting each product in its own
table. Specifying the height of the table or its rows doesn't help.
Obviously, what I need is a control that can put the names of the
products in the first row, and the info in the second row, then the
second set of products (4-6) in the third and fourth rows, and so on.
I don't know if the repeater can accomplish that. It just doesn't make
sense to use it, since it will only be able to put one item per row
(right?).
Should I just create my own table and iterate through the products,
filling it up as I go? or is there a better solution?
Thanks,
Alex