473,394 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Line Wrapping

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
12 1830
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
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
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
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
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
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
"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

what coud be causing those characters?


They are clearly in the database.

try replace (RS10.Fields("choiceData1").Value, vbcrlf, "") ?
Jul 22 '05 #9
&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
%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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alex Dribin | last post by:
Hi, Are there ready solutions for auto-wrapping lines in ostream? I am using ostream for output and want this output to be wrapped at some position. Of course I can monitor stream pointer...
11
by: name | last post by:
Here is a first attempt at a line/word wrapping utility. Seems to work okay, but lacks some checking stuff, etc. --------------------------------------------------------- #include <stdio.h>...
4
by: Brian Gideon | last post by:
All, I want to know how others deal with long lines of code. Do you care? If so, what rule(s) do you follow? Is it important to you how it looks on printed paper or displayed on the screen? ...
1
by: mg | last post by:
I set the width of a WebForm Label but do not get line wrapping (see below). What can I do to get line wrapping WebForm1.asp <asp:Labe id="Label1" style="Z-INDEX: 101; LEFT: 40px; POSITION:...
2
by: Amelyan | last post by:
If I have spaces in my Text property of Label, and I add it to TableCell, it wraps at spaces. E.g. Label lb = new Label(); lb.Text = "Hello, World!" TableCell cell = new TableCell();...
6
by: Markus Ernst | last post by:
Hi Searching for a possibility to display some text with preserved white space and line breaks, but with long lines being wrapped, I found this CSS declaration, which I found helpful: pre {...
5
by: Jason | last post by:
I have a div box with a border, and some padding left and right. It has some text with different font sizes, and a few icons. I want to cut off any overflow at the end of the line with "...",...
7
by: John den Haan | last post by:
Hello! When I use putchar to fill up an entire screen (of 80x25) with text, it seems to leave an empty line at the end, thus forcing me to scroll upwards in to see the first line. This forces me...
10
by: marss | last post by:
<hr style="height:1px"/does not fit because although a line looks like it has 1 pixel with but there are empty spaces above and below line. It can be seen if place two HR elements beside. <hr...
4
by: elukkien | last post by:
Hello! I'm trying to find a way to print out a long string (>400 characters no spaces, tabs or newlines) to a line width of 60 characters. So after every 60 characters a newline would start. Is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.