How to calculate the height of the displayed HTML table from JavaScript?

When resizing a window, I need to know how large the table is, so I can dynamically fit everything else beautifully between them. The height of the table depends solely on content that is loaded dynamically. How do you calculate the render height of a table in JavaScript?

+3
source share
1 answer

You can use element.offsetHeightfor this.

var table = document.getElementById("tableId");
alert(table.offsetHeight);
+9
source

Source: https://habr.com/ru/post/1743260/


All Articles