Solved

repeater control layout question

Posted on 2011-02-18
3
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 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