Using wrap for Label control?

Posted on 2006-03-26
Last Modified: 2008-01-09
I am working on an ASP web application and have one ascx page where I display data(which actually reads from database) in an label control which actually resides in a html table in a row which is shown in code as below:
<TABLE id="Table8" cellSpacing="0" cellPadding="0" width="670" border="0">
<TR class="PRegularText" vAlign="top">
<TD class="PRegularText" style="WIDTH: 19px" height="23">&nbsp;</TD>
<TD class="PRegularText" height="23"><asp:label id="lblSourceofRevenue" runat="server" CssClass="PRegularText"></asp:label></TD>

Now I am getting an issue that there is large text for that label the entire page display is going too far to the right making the page disaligned and errors while printing.I do want the text in that label to be wrap to next line.
If you can open the URL and click on AGR230 REquest you will se compared to other requests.
The strange thing is when displaying a question which is the normal text its automatically wrapped which is below:
<TR class="PRegularText" vAlign="top">
<TD class="PRegularText" style="WIDTH: 19px">2.</TD>
<TD class="PRegularText">If applicable, explain why creating and/or increasing a
new fund and/or line item is more appropriate than depositing the revenue into
an existing fund and increasing the appropriation authority of an existing line

Please help me with this so that my page is properly aligned with a fixed width and data in the label controls not crossing the margins? I used wrap="true" and set width="100" and other smallest possible length both in label control and also in TD and TR but of no use?
Question by:Ramana99
    LVL 5

    Expert Comment

    try STYLE="word-wrap:break-word;"
    LVL 26

    Accepted Solution

    cls u post the style for PRegularText

    also the td in which u have the label .. the width is not specified .. unless its specified in the "style"

    <TD class="PRegularText" width="200" height="23"><asp:label id="lblSourceofRevenue" runat="server" style="width:100%" CssClass="PRegularText"></asp:label></TD>

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 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

    10 Experts available now in Live!

    Get 1:1 Help Now