offsetHeight
Retrieves the height of the <TABLE> relative to the layout or coordinate parent, as specified by the offsetParent property. clientHeight
Retrieves the height of the <TABLE> without taking into account any margin, border, scroll bar, or padding that might have been applied to the <TABLE>. height
Sets or retrieves the height of the <TABLE>. e.g.
<TABLE id=theTable BORDER=1 WIDTH=80%>
<THEAD>
<TR>
<TH>Heading 1</TH>
<TH>Heading 2</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>Row 1, Column 1 text.</TD>
<TD>Row 1, Column 2 text.</TD>
</TR>
<TR>
<TD>Row 2, Column 1 text.</TD>
<TD>Row 2, Column 2 text.</TD>
</TR>
</TBODY>
</TABLE>
<script>
alert(document.all.theTable.offsetHeight)
</script>
Retrieves the height of the <TABLE> relative to the layout or coordinate parent, as specified by the offsetParent property. clientHeight
Retrieves the height of the <TABLE> without taking into account any margin, border, scroll bar, or padding that might have been applied to the <TABLE>. height
Sets or retrieves the height of the <TABLE>. e.g.
<TABLE id=theTable BORDER=1 WIDTH=80%>
<THEAD>
<TR>
<TH>Heading 1</TH>
<TH>Heading 2</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>Row 1, Column 1 text.</TD>
<TD>Row 1, Column 2 text.</TD>
</TR>
<TR>
<TD>Row 2, Column 1 text.</TD>
<TD>Row 2, Column 2 text.</TD>
</TR>
</TBODY>
</TABLE>
<script>
alert(document.all.theTable.offsetHeight)
</script>
解决方案 »
- 100分请高手帮我解决函数调用的问题
- 如何给iframe绑定click事件
- 话说,只能输入数字和下划线的正则表达式怎么写??
- 我用js写了个比较好用漂亮的树控件。
- |zyciis| 如何在Jquery Ajax中的ajaxStart停止当前Ajax的提交 谢谢
- attachevent传参的问题!!
- 关于页面中使用了DIV的打印问题,请大家帮忙! 急
- myeclipse自带的javascript编辑器,可以添加用户库,说明也是可以产生自动提示。可是为什么不起作用?
- 请问到底是哪里错了
- 各位高手请看下面的代码如何添加到asp的代码中?谢谢!!!
- 救命啊!高手们!
- getElementsByName为什么无法获得结果?
clientWidth 不包括 border 的宽度
<THEAD>
<TR>
<TH>Heading 1</TH>
<TH>Heading 2</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>Row 1, Column 1 text.</TD>
<TD>Row 1, Column 2 text.</TD>
</TR>
<TR>
<TD>Row 2, Column 1 text.</TD>
<TD>Row 2, Column 2 text.</TD>
</TR>
</TBODY>
</TABLE>
<script language="JavaScript">
var oRect = theTable.getBoundingClientRect();
var nTabHeight = oRect.bottom - oRect.top;
alert(nTabHight);
</script>