Solved

repeater control layout question

Posted on 2011-02-18
3
215 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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

790 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