<table width="200" border="1">
  <tr>
    <td onClick="alert(this.width)" width="50">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

解决方案 »

  1.   

    alert(tdId.clientWidth);To: xinyunyishui(心云意水) 
    alert(tdId.style.offsetWidth)  不要加 style 的To: kingerq(多菜鸟)
    若我的 td 没有指定 width 的宽度呢? 或者指定了宽度但被内容挤宽了呢??
      

  2.   

    !-_-
    出丑了,本来是想写tdId.style.width,后来考虑到不指定的问题,随手加了个offset就发出去了
      

  3.   

    <script>
    function viewTDWidth()
    {
       var box;
       box = document.all("test");
       alert(box.style.width);
    }
    </script><table width="200" border="1">
      <tr>
        <td id="test" width="50">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>