![]() |
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 05:30 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.