When the window is resized, I need to know how big the table is, so I can dynamically fit everything else nicely in-between. The table height is solely dependant on the contents, which are loaded dynamically. How do you calculate the rendered height of the table in JavaScript?
When the window is resized, I need to know how big the table is, so I can dynamically fit everything else nicely in-between. The table height is solely dependant on the contents, which are loaded dynamically. How do you calculate the rendered height of the table in JavaScript?
Share Improve this question edited May 28, 2017 at 17:41 Brian Tompsett - 汤莱恩 5,89372 gold badges61 silver badges133 bronze badges asked Apr 28, 2010 at 22:56 GiffyguyGiffyguy 21.3k36 gold badges102 silver badges175 bronze badges1 Answer
Reset to default 16You can use element.offsetHeight
for this.
var table = document.getElementById("tableId");
alert(table.offsetHeight);