heres an easy one i think..DataList item widths...

S

Sam Martin

Hi,

I have a user control containing a DataList. - all good.

<asp:DataList id="DataListMain" runat="server" RepeatDirection="Horizontal"
RepeatColumns="4"Width="100%" HorizontalAlign="Left">

Columns = 4, rendered Horzontaly. This works fine where is more than 4 items
in the datasource, however when <4 the items, for example 2 (because it
generates a table) are spread evenly over two cells, opposed to four;
meanning that the item widths are wider than i'd like them.

I want each cell to be the same size irrespective of whether the number of
items exceeds the RepeatColumns. I've tried setting the ItemStyle.Width
however this just puts in a style="100px" into the cell, and doesn't effect
the layout of the table.

I've tried using the "flow" repeat layout, however, as each of my items is
in fact a <table> the browser renders each item beneath the last.

there must be a simple way of setting the with of the cell no?
 
S

Sam Martin

sorry

ignore that, it was easy. just remove the width attribute.
means the table will always be as wide as the contents it holds.

thanks anyway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top