var nwidth=DataGrid1.rows[0].cells[cell].offsetWidth;
同样 这样一段代码在2各不同的html里面反应不同

解决方案 »

  1.   

    补充 var nwidth=DataGrid1.rows[0].cells[cell].offsetWidth;
    这里的cells[cell]的cell是循环变量来的
      

  2.   

    页面中除了js外,还有如下这段vscript,只要有他们存在,就会导致其他的一些错误,会不会也对offsetWidth产生影响?  <script language="vbscript">  
    function GridisExportAll()
     dim nRet 
     nRet=msgbox("您想导出所有数据吗?选择 是 则导出所有数据,否 只导出当前页数据,取消 则中止导出操作 ",3,"请问")
     if nRet=6 then 
        CDataGrid1__ctl1_ExportAll.checked=true
        GridisExportAll= true
      elseif nRet=7 then
              document.all.CDataGrid1__ctl1_ExportAll.value=false
              GridisExportAll= true
      else
              GridisExportAll= false
      end if
    end function 
       </script>