小叶白龙

小叶白龙  发表于:2009-11-18 15:10:22, 分类:技术文章

添加到网摘:

 循环中的表格宽度问题[经验]

<table><tr><%
if rs5.recordcount<>0 then
for i=1 to rs5.recordcount%>
<td align="left" <%if i mod 2=0 then%>width="100"<%else%>width="115"<%end if%>>
<font style="font-size: 11pt">
内容...</td>
<%if i mod 2=0 then%>
</tr></tr>
<%end if%>
<%rs5.movenext
if rs5.eof then exit for
next
end if
end if
%></tr>
</table>

说明:右边的内容少,而左边的内容多的时候才用到!以下根据不同的情况而采取左右两边的宽度

3种情况

第一种情况

<td align="left">
 

说明:这样会很靠左,右边会留出一块距离

第二种情况

<td align="left" width="100">

说明:大家一般都采取这样的写法,但是当左边的内容多的时候就会撑坏最外面的表格

第三种情况

<td align="left"<%if i mod 2=0 then%> width="100"<%else%>width="115"<%end if%>>

说明:这样左边的字数多也不会影响右边,因为右边的内容比较少,所以减少表格宽度

 



正在读取日志的评论数据,请稍后……
正在加载日志评论签写框,请稍后……
成员登录通道
正在载入成员登录通道...
BLOG 日历助手
正在载入日历助手...
BLOG 日志归档
BLOG 最新评论
{$SideComment}
BLOG 最新留言
{$SideGB}
BLOG 站内搜索

BLOG 友情链接