js怎么获取表格里单元格的高度和宽度!急在线等 我的表格宽度高度是用百分比来控制的 我现在想要其中某个单元格的宽度高度(px)我应该怎么弄 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <a href="http://topic.csdn.net/t/20060223/11/4572508.html">参考</a> <table style="width: 500px; height: 100px; border: solid 1px black;"> <tr style=" height:20%;"> <td style="width: 20%; border: solid 1px black;"> <input type="text" onclick="getPar(this)" /> </td> <td style="width: 80%; border: solid 1px black;"> <input type="text" onclick="getPar(this)" /> </td> </tr> <tr style=" height:80%;"> <td style="width: 20%; border: solid 1px black;"> <input type="text" onclick="getPar(this)" /> </td> <td style="width: 80%; border: solid 1px black;"> <input type="text" onclick="getPar(this)" /> </td> </tr></table><script type="text/javascript"> function getPar(thisObj) { var parentObj = thisObj.parentNode; thisObj.value = "width:" + parentObj.offsetWidth + " height:" + parentObj.offsetHeight; } </script>楼主可以试试这个. js验证url ie7刷新父页面失效 ""==0,这个表达式竟然返回 true,百思不得其解呀? 在邮件群发时,点击一个群,则该群下所有成员都被添加到收件人那里,JavaScript代码 跪求,速度 请教下js list转化成dict的 小问题 JQUERY COOKIE 问题 如何在子窗口中改变父窗口中下拉框的个数? 关于两个Frame之间参数传递的问题。左侧Frame向右侧Frame传递树节点id,右侧Frame根据id查询数据库(详细内容见内文) 在js中如何比较两个时间字符串的大小 留一个400分的问题,,高手快来那 分 table 之为什么只改变第一行的值?? 如何让A标签失效
<tr style=" height:20%;">
<td style="width: 20%; border: solid 1px black;">
<input type="text" onclick="getPar(this)" />
</td>
<td style="width: 80%; border: solid 1px black;">
<input type="text" onclick="getPar(this)" />
</td>
</tr>
<tr style=" height:80%;">
<td style="width: 20%; border: solid 1px black;">
<input type="text" onclick="getPar(this)" />
</td>
<td style="width: 80%; border: solid 1px black;">
<input type="text" onclick="getPar(this)" />
</td>
</tr>
</table><script type="text/javascript">
function getPar(thisObj) {
var parentObj = thisObj.parentNode;
thisObj.value = "width:" + parentObj.offsetWidth + " height:" + parentObj.offsetHeight;
}
</script>楼主可以试试这个.