Solved

repeater control layout question

Posted on 2011-02-18
3
214 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

816 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

11 Experts available now in Live!

Get 1:1 Help Now