<table width=600>
<tr width=200>
dddd</tr>
<tr>
eeee
</tr>
</table>
<table width=100%>
<tr width=200>
1000</tr>
<tr>
33333</tr>
</table>
<tr width=200>
dddd</tr>
<tr>
eeee
</tr>
</table>
<table width=100%>
<tr width=200>
1000</tr>
<tr>
33333</tr>
</table>
<tr>
<td>
1
</td>
</tr>
<tr>
<td>
1111111111
</td>
</tr>
</table>
不指定TABLE和TR、TD的宽度,他就会动态的按照最长的一个行来定义TABLE的宽度。
public Asize
public Bsize
public Ctext
////////////////////////////////////
//从指定字符串str中取line个字节
//汉字占用2个字节,返回子字符串
////////////////////////////////////
function Getstring(str)
StrLen=0
for i=1 to len(str)
tempstr=mid(str,i,1)
if IsThis(tempstr)="True" Then
StrLen=StrLen+1
else
StrLen=StrLen+2
end if
next
Asize=StrLen
end function
////////////////////////////////////
//判断给定字符是否为给定字符
// 返回True|False
////////////////////////////////////
function IsThis(str)
ThisStr="abcdefghijklmnopqrstuvwxyz1234567890`~!@#$%^&*()_+|-=\:;<>?,./ '"
str=Mid(str,1,1)
for i=1 to len(ThisStr)
if lcase(str)=lcase(mid(ThisStr,i,1)) or str=chr(34) then
IsThis="True"
exit function
end if
next
IsThis="False"
end functionfunction onck()
'返回数据开始
dim abc(6)
abc(0)="abcdd"
abc(1)="abcdd1112"
abc(2)="超级菜鸟88"
abc(3)="abc"
abc(4)="a"
abc(5)="ab"
'返回数据结束
Bsize=0
for i=0 to 6
Getstring abc(i)
if Asize>Bsize then Bsize=Asize:Ctext=abc(i)
next
msgbox "最长的字符串为:"&Ctext&chr(13)&chr(13)&"长度为:"&Bsize&" (字节)"&chr(13)&chr(13)&"超级菜鸟OICQ:580667",4096,"完成"
end function
onck()
</script>
<table border>
<tr><td><input value=1></td>
<tr><td><input value=11></td>
<tr><td><input value=1></td>
<tr><td><input value=11></td>
<tr><td><input value=1></td>
<tr><td><input value=11></td>
<tr><td><input value=1></td>
<tr><td><input value=11></td>
</table>