Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Formatting a DataList ItemTemplate using CSS (http://www.velocityreviews.com/forums/t779041-formatting-a-datalist-itemtemplate-using-css.html)

Nathan Sokalski 10-14-2006 06:24 AM

Formatting a DataList ItemTemplate using CSS
 
I have a DataList with the following ItemStyle and ItemTemplate:

<ItemStyle VerticalAlign="Top"/>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text="Label1" Width="300px"
style="word-wrap:normal;"/>
<asp:Label ID="Label2" runat="server" Text="Label2"
style="float:left;word-wrap:break-word;"/>
<asp:Button ID="Button1" runat="server" Text="Button1" style="float:right;"
Width="125px"/>
</ItemTemplate>

I want the output to be similar to the following:

Label1 Label2 Label2 Label2
Label2 Label2 Button1
Label2 Label2
Label2 Label2 Label2
Label2 Label2
Label2 Label2 Label2
Label2 Label2
Label2 Label2 Label2
Label2 Label2
Label2

What this is is a fixed-width label, a variable-width label that might wrap,
and a button. I want the variable-width label to take up the space between
the fixed-width label and the button, and I want the button to always be
right-aligned. What would be the best way to do this in an asp:DataList's
ItemTemplate? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/




All times are GMT. The time now is 11:30 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.