本文介绍了线包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法阻止IE强制换行?在下面的列表2中,

您注意到''.jpg''的表背景图像扩展开始一个新行,

而不是保持在同一行上'的文件名。同样的情况发生在我的

javascript onclick事件中,IE强制换行并打破我的代码。在我的

asp代码中,你注意到我正在插入换行符,但IE似乎做了它想要的b / b
。我应该注意,下面的HTML结果实际上是1个40左右的表格

asp构建为字符串。


我提到这是因为有些表得到了没有换行符渲染

跟随''jpg''和javascript代码。我的问题是,当IE强制下面的线路断开时,代码不能正常工作。


有什么想法吗?


上市1 - 代码


ColorInfo = ColorInfo& "&table; 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>< /表>< / TR>" &安培; chr(13)& chr(10)

ColorInfo = ColorInfo& "< tr>< td align = center>< font

face ="" verdana,sans-serif""大小= 1>" &安培;替换(RS10(choiceName),

,< br>,1,1)& "< /字体>< / TD>< / TR>< /表>< / TD>" &安培; chr(13)& chr(10)

上市2 - 结果


< 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>

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>

推荐答案









您确定源不包含换行符吗?这有效吗

更好吗?


...... &安培;修剪(RS10.Fields(" choiceData1")。Value)& " .jpg""


-

Dave Anderson


未经请求的商业电子邮件将在费用为



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


这篇关于线包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 19:33