Line Wrapping

Discussion in 'ASP General' started by scott, May 26, 2005.

  1. scott

    scott Guest

    Is there a way to prevent IE from forcing a line break? Below in LISTING 2,
    you notice the table background image extention of '.jpg' begins a new line,
    instead of staying on the same line as it's file name. Same happens with my
    javascript onclick event, IE forces a line break and breaks my code. In my
    asp code, you notice I'm inserting line breaks, but IE seems to do what it
    wants. I should note, the below HTML results is actually 1 table of 40 or so
    that asp builds as a string.

    I mention that because some tables get rendered without line breaks
    following the 'jpg' and javascript code. My prolem is that when IE forces
    line breaks as below, the code doesn' work.

    Any ideas?

    LISTING 1 - CODE

    ColorInfo = ColorInfo & "<table border=0
    background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
    style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>" & chr(13) &
    chr(10)
    ColorInfo = ColorInfo & "<tr><td>" & chr(13) & chr(10)
    ColorInfo = ColorInfo & "<a href=""""
    onclick=""javascript:pW('pop_print.asp?print=" & RS10("choiceData1") &
    "',310,400);return false;"">" & chr(13) & chr(10)
    ColorInfo = ColorInfo & "<img src=""images/filler.gif"" width=60
    height=40 border=0></a>" & chr(13) & chr(10)
    ColorInfo = ColorInfo & "</td></tr></table></tr>" & chr(13) & chr(10)
    ColorInfo = ColorInfo & "<tr><td align=center><font
    face=""verdana,sans-serif"" size=1>" & Replace(RS10("choiceName"),"
    ","<br>",1,1) & "</font></td></tr></table></td>" & chr(13) & chr(10)


    LISTING 2 - RESULTS

    <table border=0 background="images/prints/thumb_Abbey
    ..jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
    <tr><td>
    <a href="" onclick="javascript:pW('pop_print.asp?print=Abbey
    ',310,400);return false;">
    <img src="images/filler.gif" width=60 height=40 border=0></a>
    </td></tr></table>
    scott, May 26, 2005
    #1
    1. Advertising

  2. scott

    scott Guest

    I tried it, but as you see below, it had no effect. is there any way to
    structure my below html so the NOWRAP will work for my problem? i see how it
    works with regular text, but my case is a little different.

    <table border=0><tr><td NOWRAP align=center>
    <table border=0 background="images/prints/thumb_Abbey
    ..jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
    <tr><td NOWRAP><a href="" onclick="javascript:pW('pop_print.asp?print=Abbey
    ',310,400);return false;">
    <img src="images/filler.gif" width=60 height=40 border=0></a>
    </td></tr></table></tr>
    <tr><td align=center><font face="verdana,sans-serif" size=1>Abbey<br>(AYSP)
    </font></td></tr></table>


    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:...
    > put it in a Table Cell with NOWRAP on
    >
    > --
    > Curt Christianson
    > Site & Scripts: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "scott" <> wrote in message
    > news:OkjSi$...
    >> Is there a way to prevent IE from forcing a line break? Below in LISTING
    >> 2, you notice the table background image extention of '.jpg' begins a new
    >> line, instead of staying on the same line as it's file name. Same happens
    >> with my javascript onclick event, IE forces a line break and breaks my
    >> code. In my asp code, you notice I'm inserting line breaks, but IE seems
    >> to do what it wants. I should note, the below HTML results is actually 1
    >> table of 40 or so that asp builds as a string.
    >>
    >> I mention that because some tables get rendered without line breaks
    >> following the 'jpg' and javascript code. My prolem is that when IE forces
    >> line breaks as below, the code doesn' work.
    >>
    >> Any ideas?
    >>
    >> LISTING 1 - CODE
    >>
    >> ColorInfo = ColorInfo & "<table border=0
    >> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
    >> style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>" & chr(13)
    >> & chr(10)
    >> ColorInfo = ColorInfo & "<tr><td>" & chr(13) & chr(10)
    >> ColorInfo = ColorInfo & "<a href=""""
    >> onclick=""javascript:pW('pop_print.asp?print=" & RS10("choiceData1") &
    >> "',310,400);return false;"">" & chr(13) & chr(10)
    >> ColorInfo = ColorInfo & "<img src=""images/filler.gif"" width=60
    >> height=40 border=0></a>" & chr(13) & chr(10)
    >> ColorInfo = ColorInfo & "</td></tr></table></tr>" & chr(13) & chr(10)
    >> ColorInfo = ColorInfo & "<tr><td align=center><font
    >> face=""verdana,sans-serif"" size=1>" & Replace(RS10("choiceName"),"
    >> ","<br>",1,1) & "</font></td></tr></table></td>" & chr(13) & chr(10)
    >>
    >>
    >> LISTING 2 - RESULTS
    >>
    >> <table border=0 background="images/prints/thumb_Abbey
    >> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
    >> <tr><td>
    >> <a href="" onclick="javascript:pW('pop_print.asp?print=Abbey
    >> ',310,400);return false;">
    >> <img src="images/filler.gif" width=60 height=40 border=0></a>
    >> </td></tr></table>
    >>

    >
    >
    scott, May 26, 2005
    #2
    1. Advertising

  3. scott wrote:
    > Is there a way to prevent IE from forcing a line break? Below in
    > LISTING 2, you notice the table background image extention of '.jpg'
    > begins a new line, instead of staying on the same line as it's file
    > name...
    >
    > background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
    >
    > <table border=0 background="images/prints/thumb_Abbey
    > .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>


    Are you certain the source does not contain the line break? Does this work
    any better?

    ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, May 26, 2005
    #3
  4. scott

    scott Guest

    no go, i tried your code. It must be the way IIS renders it. at first, i
    thought it was long field values, but it does it on 5 character values or
    long ones.

    i know there must be a solution, but i've exhausted all means.


    "Dave Anderson" <> wrote in message
    news:%...
    > scott wrote:
    >> Is there a way to prevent IE from forcing a line break? Below in
    >> LISTING 2, you notice the table background image extention of '.jpg'
    >> begins a new line, instead of staying on the same line as it's file
    >> name...
    >>
    >> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
    >>
    >> <table border=0 background="images/prints/thumb_Abbey
    >> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>

    >
    > Are you certain the source does not contain the line break? Does this work
    > any better?
    >
    > ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""
    >
    >
    >
    > --
    > Dave Anderson
    >
    > Unsolicited commercial email will be read at a cost of $500 per message.
    > Use of this email address implies consent to these terms. Please do not
    > contact me directly or ask me to contact you directly for assistance. If
    > your question is worth asking, it's worth posting.
    >
    scott, May 26, 2005
    #4
  5. scott

    Mark Schupp Guest

    IIRC Trim will not remove linefeeds.

    Try writing out Server.URLEncode(RS10.Fields("choiceData1").Value) to see if
    there is something else in the data.

    I use similar code to build image urls all the time with no problems.

    --
    --Mark Schupp


    "scott" <> wrote in message
    news:%...
    > no go, i tried your code. It must be the way IIS renders it. at first, i
    > thought it was long field values, but it does it on 5 character values or
    > long ones.
    >
    > i know there must be a solution, but i've exhausted all means.
    >
    >
    > "Dave Anderson" <> wrote in message
    > news:%...
    >> scott wrote:
    >>> Is there a way to prevent IE from forcing a line break? Below in
    >>> LISTING 2, you notice the table background image extention of '.jpg'
    >>> begins a new line, instead of staying on the same line as it's file
    >>> name...
    >>>
    >>> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
    >>>
    >>> <table border=0 background="images/prints/thumb_Abbey
    >>> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>

    >>
    >> Are you certain the source does not contain the line break? Does this
    >> work any better?
    >>
    >> ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""
    >>
    >>
    >>
    >> --
    >> Dave Anderson
    >>
    >> Unsolicited commercial email will be read at a cost of $500 per message.
    >> Use of this email address implies consent to these terms. Please do not
    >> contact me directly or ask me to contact you directly for assistance. If
    >> your question is worth asking, it's worth posting.
    >>

    >
    >
    Mark Schupp, May 26, 2005
    #5
  6. scott

    scott Guest

    your server encode idea produced some interesting results. it still doesn't
    work, but it maintained the filename. problem is it added %0D%OA as you can
    see below. It only had that effect on certain records and there was no
    pattern or sequence on which ones didn't work. it effected the same records
    as before.

    what coud be causing those characters?

    <table border=0><tr><td NOWRAP align=center>
    <table border=0 background="images/prints/thumb_Abbey%0D%0A.jpg"
    style='border:solid 1pt #000000;margin: 0px;' cellpadding=0 cellspacing=0>
    <tr><td NOWRAP><NOBR><a href=""
    onclick="javascript:pW('pop_print.asp?print=Abbey
    ',310,400);return false;"></NOBR>
    <img src="images/filler.gif" width=60 height=40 border=0></a>
    </td></tr></table></tr>
    <tr><td align=center><font face="verdana,sans-serif" size=1>Abbey<br>(AYSP)
    </font></td></tr></table>


    "Mark Schupp" <> wrote in message
    news:%23$...
    > IIRC Trim will not remove linefeeds.
    >
    > Try writing out Server.URLEncode(RS10.Fields("choiceData1").Value) to see
    > if there is something else in the data.
    >
    > I use similar code to build image urls all the time with no problems.
    >
    > --
    > --Mark Schupp
    >
    >
    > "scott" <> wrote in message
    > news:%...
    >> no go, i tried your code. It must be the way IIS renders it. at first, i
    >> thought it was long field values, but it does it on 5 character values or
    >> long ones.
    >>
    >> i know there must be a solution, but i've exhausted all means.
    >>
    >>
    >> "Dave Anderson" <> wrote in message
    >> news:%...
    >>> scott wrote:
    >>>> Is there a way to prevent IE from forcing a line break? Below in
    >>>> LISTING 2, you notice the table background image extention of '.jpg'
    >>>> begins a new line, instead of staying on the same line as it's file
    >>>> name...
    >>>>
    >>>> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
    >>>>
    >>>> <table border=0 background="images/prints/thumb_Abbey
    >>>> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
    >>>
    >>> Are you certain the source does not contain the line break? Does this
    >>> work any better?
    >>>
    >>> ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""
    >>>
    >>>
    >>>
    >>> --
    >>> Dave Anderson
    >>>
    >>> Unsolicited commercial email will be read at a cost of $500 per message.
    >>> Use of this email address implies consent to these terms. Please do not
    >>> contact me directly or ask me to contact you directly for assistance. If
    >>> your question is worth asking, it's worth posting.
    >>>

    >>
    >>

    >
    >
    scott, May 27, 2005
    #6
  7. scott

    Giles Guest


    >>
    >> what coud be causing those characters?

    >
    > They are clearly in the database.
    >

    try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?
    Giles, May 27, 2005
    #7
  8. &nbsp;

    instead of just normal spaces

    can cause trouble as well



    "Giles" <> wrote in message
    news:%...
    >
    >>>
    >>> what coud be causing those characters?

    >>
    >> They are clearly in the database.
    >>

    > try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?
    >
    Kyle Peterson, May 27, 2005
    #8
  9. scott

    Mark Schupp Guest

    %0D%0A = CRLF
    That is causing your line wrap. You will need to strip it out before
    building the URL. See Giles' suggestion.
    You should also have a look into your input application to see why it is
    including the CRLF at the end of file names.

    --
    --Mark Schupp


    "scott" <> wrote in message
    news:%...
    > your server encode idea produced some interesting results. it still
    > doesn't work, but it maintained the filename. problem is it added %0D%OA
    > as you can see below. It only had that effect on certain records and
    > there was no pattern or sequence on which ones didn't work. it effected
    > the same records as before.
    >
    > what coud be causing those characters?
    >
    > <table border=0><tr><td NOWRAP align=center>
    > <table border=0 background="images/prints/thumb_Abbey%0D%0A.jpg"
    > style='border:solid 1pt #000000;margin: 0px;' cellpadding=0 cellspacing=0>
    > <tr><td NOWRAP><NOBR><a href=""
    > onclick="javascript:pW('pop_print.asp?print=Abbey
    > ',310,400);return false;"></NOBR>
    > <img src="images/filler.gif" width=60 height=40 border=0></a>
    > </td></tr></table></tr>
    > <tr><td align=center><font face="verdana,sans-serif"
    > size=1>Abbey<br>(AYSP)
    > </font></td></tr></table>
    >
    >
    > "Mark Schupp" <> wrote in message
    > news:%23$...
    >> IIRC Trim will not remove linefeeds.
    >>
    >> Try writing out Server.URLEncode(RS10.Fields("choiceData1").Value) to see
    >> if there is something else in the data.
    >>
    >> I use similar code to build image urls all the time with no problems.
    >>
    >> --
    >> --Mark Schupp
    >>
    >>
    >> "scott" <> wrote in message
    >> news:%...
    >>> no go, i tried your code. It must be the way IIS renders it. at first, i
    >>> thought it was long field values, but it does it on 5 character values
    >>> or long ones.
    >>>
    >>> i know there must be a solution, but i've exhausted all means.
    >>>
    >>>
    >>> "Dave Anderson" <> wrote in message
    >>> news:%...
    >>>> scott wrote:
    >>>>> Is there a way to prevent IE from forcing a line break? Below in
    >>>>> LISTING 2, you notice the table background image extention of '.jpg'
    >>>>> begins a new line, instead of staying on the same line as it's file
    >>>>> name...
    >>>>>
    >>>>> background=""images/prints/thumb_" & RS10("choiceData1") & ".jpg""
    >>>>>
    >>>>> <table border=0 background="images/prints/thumb_Abbey
    >>>>> .jpg" style='border:solid 1pt #000000' cellpadding=0 cellspacing=0>
    >>>>
    >>>> Are you certain the source does not contain the line break? Does this
    >>>> work any better?
    >>>>
    >>>> ..." & Trim(RS10.Fields("choiceData1").Value) & ".jpg""
    >>>>
    >>>>
    >>>>
    >>>> --
    >>>> Dave Anderson
    >>>>
    >>>> Unsolicited commercial email will be read at a cost of $500 per
    >>>> message. Use of this email address implies consent to these terms.
    >>>> Please do not contact me directly or ask me to contact you directly for
    >>>> assistance. If your question is worth asking, it's worth posting.
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Mark Schupp, May 27, 2005
    #9
  10. Mark Schupp wrote:
    > IIRC Trim will not remove linefeeds.


    Yet another reason I like the flexibility of writing my own:

    String.prototype.trim = function(){
    return this.replace(/(\s*$)|(^\s*)/g,"")
    }


    Or the more abstracted:

    String.prototype.ltrim = function(){
    return this.replace(/^\s*/g,"")
    }
    String.prototype.rtrim = function(){
    return this.replace(/\s*$/g,"")
    }
    String.prototype.trim = function(){
    return this.ltrim().rtrim()
    }

    I am obviously JScript-biased.


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, May 27, 2005
    #10
  11. scott

    scott Guest

    I tried all solution, but none would strip out the extra space. However, big
    thanks to all for identifying the problem. When I get physical access to the
    db, I will manually clean the offending records. This probably happened
    while someone was copy/pasting. It shall not happen again.

    Thanks to all of you for saving my sanity.


    "Giles" <> wrote in message
    news:%...
    >
    >>>
    >>> what coud be causing those characters?

    >>
    >> They are clearly in the database.
    >>

    > try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?
    >
    scott, May 27, 2005
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWc=?=

    Line wrapping with WebForm Label

    =?Utf-8?B?bWc=?=, Jan 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    389
    =?Utf-8?B?QmFycnkgRm9ycmVzdA==?=
    Jan 19, 2004
  2. Amelyan
    Replies:
    2
    Views:
    658
    Amelyan
    May 21, 2005
  3. Gnarlodious
    Replies:
    9
    Views:
    13,370
    Bernhard Sturm
    Jan 28, 2005
  4. Carolyn Marenger

    horizontal menu line wrapping issue

    Carolyn Marenger, Mar 18, 2006, in forum: HTML
    Replies:
    4
    Views:
    656
    dorayme
    Mar 19, 2006
  5. Alex Dribin

    Line wrapping in ostream

    Alex Dribin, Aug 6, 2003, in forum: C++
    Replies:
    2
    Views:
    349
    Dietmar Kuehl
    Aug 6, 2003
Loading...

Share This Page