<script>
if (screen.width==1024 &&screen.height==768) {
t.width=95%;
else
t.width=60%;
</script>
<table id=t>
......
if (screen.width==1024 &&screen.height==768) {
t.width=95%;
else
t.width=60%;
</script>
<table id=t>
......
<body>
<table id=t border=1>
<tr><td>sdfsfsd</td></tr>
</table>
</body>
<script>
if (screen.width==1024 &&screen.height==768) {
t.width="95%";
} else {
t.width="60%";
}
</script></html>这回绝对没问题,我测试过了!!
<HEAD>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=GB2312"/>
<TITLE></TITLE>
<META NAME="Copyright" CONTENT="Baby Studio"/>
<META NAME="Email" CONTENT="[email protected]"/>
<META NAME="Keywords" CONTENT=""/>
<META NAME="Description" CONTENT=""/>
</HEAD><BODY onload="tableWidth()">
<table id=mytable>
<tr><td></td></tr></table>
<script>
function tableWidth()
{
if(screen.width==1024)
document.all.item("mytable").width="60%";
if(screen.width==800)
document.all.item("mytable").width="95%";
}
</script>
</BODY>
</HTML>