还是表格的问题:response.write rst("stext")把表格撑大了

zyxwh 2003-05-10 08:47:26
还是表格的问题:response.write rst("stext")把表格撑大了
我把表格设成百分比、像素都不行,加上取掉nowrap也不行,
又加了 style属性固定列宽,结果长出去的文字被截掉了,
撑大的表格可以大到屏幕的几倍宽,是什么原因?
<tr height="13" >
<td width="17%" rowspan="2" align="left" valign="top" bgcolor="#e6e6cc" >
</td>
<td width="48%" bgcolor="#e6e6cc" nowrap height="22" ></td>
</tr>
<tr>
<td bgcolor="#e6e6cc" align="left" style="WORD-WRAP: break-word" valign="top" colspan="2">
<font size="2">
<%
str=Replace(rst_hf("stext"),chr(13),"<br/>")
Response.write(str)
%>
</font> </td>
</tr>

...全文
57 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyxwh 2003-05-10
  • 打赏
  • 举报
回复
我现在怀疑是浏览器或本地IIS的问题,我在家里面也没有问题,来了公司就有了,
我设置的2号字,但是浏览器中设与不设是一样的,现在浏览器中的字也比以前大(当然只针对我
的IIS服务器,不对外部网页),而且所有的“4”字体都是都比较黑粗,我晕。。。
美丽心情 2003-05-10
  • 打赏
  • 举报
回复
<%set rs=server.CreateObject("ADODB.recordset")
sql="select * from gameinfo"
rs.open sql,conn,1,1%>
<table width="78%" border="0" align="center" style="TABLE-LAYOUT: fixed" >
<tr>
<td width="17%" bgcolor="#e6e6cc"> <div align="right"><font size="2">帖子主题:</font></div></td>
<td bgcolor="#e6e6cc" colspan="2">  </td>
</tr>
<tr>
<td rowspan="2" align="left" valign="top" bgcolor="#e6e6cc" width="17%" >
<p><font size="2">发表人:</font></p>
<p align='center'><font size="2"><img src=''></font></p>
<p><font size="2" align="left">级别:<br>
</font> <font size="2" align="left">信誉:<br>
</font> </p></td>
<td width="48%" bgcolor="#e6e6cc" nowrap height="22" > <font size="2">→消息 
→查看  →好友  →邮件</font> </td>
<td width="35%" bgcolor="#e6e6cc" ><font size="2">发表时间:
</font> </td>
</tr>
<tr>
<td bgcolor="#e6e6cc" align="left" valign="top" colspan="2" ><font size="2"> 
</font> </td>
</tr>
<tr height="13" >
<td width="17%" rowspan="2" align="left" valign="top" bgcolor="#e6e6cc" >
<p><font size="2">回复人:</font></p>
<p align='center'><font size="2"><img src=''></font></p>
<p><font size="2" align="left">级别:<br>
</font> <font size="2" align="left">信誉:<br>
</font></p></td>
<td width="48%" bgcolor="#e6e6cc" nowrap height="22" > <font size="2">→消息 
→查看  →好友  →邮件</font></td>
<td width="35%" bgcolor="#e6e6cc" ><font size="2">发表时间:
</font></td>
</tr>
<tr>
<td bgcolor="#e6e6cc" align="left" style="WORD-WRAP: break-word" valign="top" colspan="2">
<font size="2">  </font> </td>
</tr>
<%do while not rs.eof%>
<tr>
<td align="left" valign="top" bgcolor="#e6e6cc" rowspan="2"> </td>
<td bgcolor="#e6e6cc" align="left" style="WORD-WRAP: break-word" valign="top"> </td>
<td bgcolor="#e6e6cc" align="left" style="WORD-WRAP: break-word" valign="top"> </td>
</tr>

<tr>
<td colspan="2" align="left" valign="top" bgcolor="#e6e6cc" ><%'=rs("title")%><%=rs("detail")%></td>
</tr>
<%rs.movenext
loop%>
</table>
美丽心情 2003-05-10
  • 打赏
  • 举报
回复
以前我也遇到过相同的问题,一般都是循环写的位置有问题~~~~
美丽心情 2003-05-10
  • 打赏
  • 举报
回复
我试过了,没有你说的问题

我把所有ASP都去掉,用我自己的数据库和字段(里面没有回车付)没有问题,当然,我没有用循环,可见,是你的循环出现问题了
esaler 2003-05-10
  • 打赏
  • 举报
回复
不要%,要px
esaler 2003-05-10
  • 打赏
  • 举报
回复
不可能,把你的表格设置好宽度!!
zyxwh 2003-05-10
  • 打赏
  • 举报
回复
<table width="78%" border="0" align="center" style="TABLE-LAYOUT: fixed" >
<tr>
<td width="17%" bgcolor="#e6e6cc">
<div align="right"><font size="2">帖子主题:</font></div>
</td>
<td bgcolor="#e6e6cc" colspan="2"><font size="2"><%=rst_title("title") %></font></td>
</tr>
<tr>
<td rowspan="2" align="left" valign="top" bgcolor="#e6e6cc" width="17%" >
<p><font size="2">发表人:<%=rst_title("writename") %></font></p>
<p align='center'><font size="2"><img src=''></font></p>
<p><font size="2" align="left">级别:<%=rst_user("jb") %><br>
</font> <font size="2" align="left">信誉:<%=rst_user("xy") %><br>
</font> </p>
</td>
<td width="48%" bgcolor="#e6e6cc" nowrap height="22" > <font size="2"><a href="writemsg.asp?un=<% =rst_user("username") %>" target='_blank'>→消息</a> 
<a href='viewuser.asp?un=<% =rst_user("username")%>' target='_blank'>→查看</a> 
<a href='addfriend.asp?un=<% =rst_user("username")%>' target='_blank'> →好友</a> 
<a href='mailto:<%=rst_user("email")%>'> →邮件</a></font></td>
<td width="35%" bgcolor="#e6e6cc" ><font size="2">发表时间:
<% =rst_title("writedate") %>
</font></td>
</tr>
<tr>
<td bgcolor="#e6e6cc" align="left" valign="top" colspan="2" ><font size="2">
<%
str=Replace(rst_title("stext"),chr(13),"<br/>")
Response.write str
%></font>
</td>
</tr>
<% rst_user.close
strsql="select * from table_hf where titlesn=" & request("sn")&" order by hfdate"
set rst_hf=server.createobject("ADODB.Recordset")
rst_hf.open strsql,db,1
if (not rst_hf.bof) and (not rst_hf.eof) then
dim page_size
dim page_no
dim page_total
page_size=10
If Request.QueryString("page_no")="" Then
page_no=1
Else
page_no=Cint(Request.QueryString ("page_no"))
End If
rst_hf.PageSize=page_size
page_total=rst_hf.PageCount
rst_hf.AbsolutePage=page_no
dim i
i=page_size
do while (not rst_hf.eof) and i>0
i=i-1
strsql="select * from table_user where username='" &rst_hf("username")&"'"
rst_user.open strsql,db,1

%>
<tr height="13" >
<td width="17%" rowspan="2" align="left" valign="top" bgcolor="#e6e6cc" >
<p><font size="2">回复人:<%=rst_hf("username") %></font></p>
<p align='center'><font size="2"><img src=''></font></p>
<p><font size="2" align="left">级别:<%=rst_user("jb") %><br>
</font> <font size="2" align="left">信誉:<%=rst_user("xy") %><br>
</font></p>
</td>
<td width="48%" bgcolor="#e6e6cc" nowrap height="22" > <font size="2"><a href="writemsg.asp?un=<% =rst_user("username") %>" target='_blank'>→消息</a> 
<a href='viewuser.asp?un=<% =rst_user("username")%>' target='_blank'>→查看</a> 
<a href='addfriend.asp?un=<% =rst_user("username")%>' target='_blank'> →好友</a> 
<a href='mailto:<%=rst_user("email")%>'> →邮件</a></font></td>
<td width="35%" bgcolor="#e6e6cc" ><font size="2">发表时间:
<% =rst_hf("hfdate") %>
</font></td>
</tr>
<tr>
<td bgcolor="#e6e6cc" align="left" style="WORD-WRAP: break-word" valign="top" colspan="2">
<font size="2">
<%
str=Replace(rst_hf("stext"),chr(13),"<br/>")
Response.write(str)
%>
</font> </td>
</tr>
<%
rst_hf.movenext
rst_user.close
loop
%>
</table>
bansong 2003-05-10
  • 打赏
  • 举报
回复
好象英文和中文也有区别的哦
美丽心情 2003-05-10
  • 打赏
  • 举报
回复
哦?

是不是其他的地方,或是循环之类的地方出问题了??

把所有代码贴出来,才好找错误


还有,你的stext是什么内容?

zyxwh 2003-05-10
  • 打赏
  • 举报
回复
<p> </p>试了,不起作用
stext的内容是由文本框输入的内容,就是论坛发表主题和回复的内容。
我故意不输入回车,就出现上述情况
xjdawu 2003-05-10
  • 打赏
  • 举报
回复
Try:
<p>
<font size="2">
<%
str=Replace(rst_hf("stext"),chr(13),"<br/>")
Response.write(str)
%>
</font>
</p>
rongdede 2003-05-10
  • 打赏
  • 举报
回复
你的stext是什么内容?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧