<script>
var xx=screen.width;
switch xx{
case "800":{
document.all.tableId.background="url";
break;
}
..............
}
</script>

解决方案 »

  1.   

    <table id=mytable><tr><td>hello</td></tr></table>
    <script>
    if((screen.width==800)&&(screen.height==600))
    document.all.mytable.style.background="yellow";
    else
    document.all.mytable.style.background="blue";
    </script>
      

  2.   

    window.screen.width
    window.screen.height
      

  3.   

    <script>
    var xx=screen.width;
    switch (xx){
    case "800":{
    document.all.tableId.background="url";
    break;
    }
    ..............
    }
    </script>
    加到正个页面最后,或定义成函数,在body onload中调用
      

  4.   

    sorry 哦,马虎,该打.............
    <script>
    var xx=screen.width;
    switch (xx){
    case 800:{
    document.all.tableId.background="url";
    break;
    }
    ..............
    }
    </script>
      

  5.   

    document.all.tableId.background="url";这个方法好像不行,你测过没有,
      

  6.   

    为什么老有这个提示啊,document.all.top1为空或不是对象,top1是table的id号,代码如下
    <script>
    if ((window.screen.width=="800")&&(screen.height=="600"))
    document.all.top1.background ="http://localhost/CopHomepage/img/back_0d01.png";
    else 
    document.all.top1.background ="img/back_0d01.png";
    </script>