Calcular el height de un elemento variable

Enddor
17 de Octubre del 2003
Hola a to2, necesito calcular en height de un elemento contenedor en función de la cantidad de datos, que varian, que contiene.

Tengo una función, que pasandole el ID del elemento me devuelve el height, pero lo intento usar con div, table, td y siempre me pone "auto", es lo siguiente:

function getElementStyle(elemID)
{
var elem = document.getElementById(elemID);
if (elem.currentStyle)
{
return elem.currentStyle["height"];
}
else if (window.getComputedStyle)
{
var compStyle = window.getComputedStyle(elem, "");
return compStyle.getPropertyValue("height");
}
return "";
}

Eso es todo, Gracias