|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
how can I get the width and height of a table cell
is there anyway I can get the width and height of a table cell that was defined with a * or indeed a percentage value?
I'm hoping! |
|
#2
|
|||
|
|||
|
RE: how can I get the width and height of a table cell
Sure, just give the cell an id like:
<table> <tr> <td id="thecell">foo</td> </tr> </table> now in javascript you can get the height and width using the following: document.getElementById('thecell').offsetHeight; document.getElementById('thecell').offsetWidth; Hope this helps |
|
#3
|
|||
|
|||
|
RE: how can I get the width and height of a table cell
thanks I will try that and let you know
|
|
#4
|
|||
|
|||
|
RE: how can I get the width and height of a table cell
that showed up as 0, I guess it needs to totally display stuff first. darn, I need to get this when I create the table cell.
|
|
#5
|
|||
|
|||
|
RE: how can I get the width and height of a table cell
guess I will have to make the contents invisible, then resize after loading, the show it.
Thanks anyway |
|
#6
|
|||
|
|||
|
RE: how can I get the width and height of a table cell
it works fine, little bit of a bodge but it works fine, thanks
|
|
#7
|
|||
|
|||
|
RE: how can I get the width and height of a table cell
That's right, the browser waits for the </table> to arrive before the contents is actually rendered. Up untill then there is no way of knowing how big the cell is gonna get.
Glad you got it to work |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > how can I get the width and height of a table cell |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|