By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 802 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Line Wrapping

P: n/a
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>
Jul 22 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
put it in a Table Cell with NOWRAP on

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"scott" <sb*****@mileslumber.com> wrote in message
news:Ok*************@TK2MSFTNGP15.phx.gbl...
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>

Jul 22 '05 #2

P: n/a
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:uJ*************@TK2MSFTNGP12.phx.gbl...
put it in a Table Cell with NOWRAP on

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"scott" <sb*****@mileslumber.com> wrote in message
news:Ok*************@TK2MSFTNGP15.phx.gbl...
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>


Jul 22 '05 #3

P: n/a
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.
Jul 22 '05 #4

P: n/a
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" <GT**********@spammotel.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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.

Jul 22 '05 #5

P: n/a
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" <sb*****@mileslumber.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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" <GT**********@spammotel.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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.


Jul 22 '05 #6

P: n/a
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" <no******@email.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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" <sb*****@mileslumber.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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" <GT**********@spammotel.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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.



Jul 22 '05 #7

P: n/a
"scott" wrote:
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?


They are clearly in the database.

--
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.
Jul 22 '05 #8

P: n/a

what coud be causing those characters?


They are clearly in the database.

try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?
Jul 22 '05 #9

P: n/a
&nbsp;

instead of just normal spaces

can cause trouble as well

"Giles" <Gi***@NoSpam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

what coud be causing those characters?


They are clearly in the database.

try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?

Jul 22 '05 #10

P: n/a
%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" <sb*****@mileslumber.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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" <no******@email.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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" <sb*****@mileslumber.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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" <GT**********@spammotel.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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.



Jul 22 '05 #11

P: n/a
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.
Jul 22 '05 #12

P: n/a
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" <Gi***@NoSpam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

what coud be causing those characters?


They are clearly in the database.

try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?

Jul 22 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.