Solved

repeater control layout question

Posted on 2011-02-18
3
212 Views
Last Modified: 2012-05-11
i am using a repeater control. Can somebody tell me how to make the content in the label control to wrap to the next line if it reaches a certain length?  Currently, it is causing the control itself to stretch


<ItemTemplate>
                     <font size="2"><b><label style="padding-right:93px;">Category ID</label><%#Eval("Category_ID")%><b></font> 
                                                
                        <br />
                         <font size="2"><b><label style="padding-right:82px;">Category Path</label><%#Eval("Category_ID")%><b></font> 
                        <br />
                        <font size="2"><b><label style="padding-right:126px;">Name</label><%#Eval("Category_Name")%><b></font> 
                        <br />
                        <font size="2"><b><label style="padding-right:93px;">Description</label><%#Eval("Category_Description")%><b></font> 
                       <br />
                        <font size="2"><b><label style="padding-right:67px;">Parent Category</label><%#Eval("Category_ID")%><b></font> 
                       <br />
                        <font size="2"><b><label style="padding-right:125px;">Image</label><%#Eval("Image_Name")%><b></font> 
                       <br />                                         
                      </ItemTemplate>

Open in new window

0
Comment
Question by:vbnetcoder
3 Comments
 
LVL 7

Expert Comment

by:iopen
ID: 34931113
You could try putting a fixed width in your ItemTemplate

        <asp:Repeater ID="Repeater1" runat="server">
        <HeaderTemplate>
                <table border="1" width="100%">
                    <tr bgcolor=Gray>
                    <th>Category ID</th>
                    <th>Category Path</th>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Parent Category</th>
                    <th>Image</th>
                    </tr>
        </HeaderTemplate>        
        <ItemTemplate>
                    <tr>
                         <td width ="110"><%#Eval("Category_ID")%></td>
                         <td width ="110"><%#Eval("Category_ID")%></td>
                    <td width ="110"><%#Eval("Category_Name")%></td>
                    <td width ="110"><%#Eval("Category_Description")%></td>
                    <td width ="110"><%#Eval("Category_ID")%></td>
                    <td width ="110"><%#Eval("Image_Name")%></td>
                    </tr>
        </ItemTemplate>
        <FooterTemplate>
                        </table>
          </FooterTemplate>
        </asp:Repeater>

You would have to play with the widths to get to desired result...
0
 
LVL 13

Accepted Solution

by:
devlab2012 earned 500 total points
ID: 34932696
In above code, change the <table> tag to :

<table border="1" width="100%" style="table-layout:fixed">
0
 

Author Closing Comment

by:vbnetcoder
ID: 34981433
ty
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now