Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

height of cell

Status
Not open for further replies.

russland

Programmer
Joined
Jan 9, 2003
Messages
315
Location
CH
how do I retrieve height of a cell that has no height value assigned? see example below. any idea?
thanks
chimera


<table>
<tr>
<td id=&quot;master&quot;><img src=&quot;blind.gif&quot; width=&quot;1&quot; height=&quot;10&quot; alt=&quot;&quot; border=&quot;0&quot;>blah blah blah blah blah blah blah blah blah blah blah</td>
</tr>
</table>
<script language=&quot;JavaScript&quot;>
function retHeight(id)
{
var cell = document.getElementById(id);
alert(cell.height);
}
</script>
<input type=&quot;Button&quot; value=&quot;alert&quot; onclick=&quot;retHeight('master')&quot;>
 
Use the clientHeight method:
Code:
<table>
  <tr>
    <td id=&quot;master&quot;>
      <img src=&quot;blind.gif&quot; width=&quot;1&quot; height=&quot;10&quot; alt=&quot;&quot; border=&quot;0&quot;>blah blah blah blah
</table>

<script language=&quot;JavaScript&quot;>
  function retHeight(id)
  {
    var cell = document.getElementById(id);
    alert(cell.clientHeight);
  }
</script>

<input type=&quot;Button&quot; value=&quot;alert&quot; onclick=&quot;retHeight('master')&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top