SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old April 27th, 2003, 09:02 PM
madhombre madhombre is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: WI
Posts: 247 madhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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!


Reply With Quote
  #2  
Old April 27th, 2003, 09:09 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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

Reply With Quote
  #3  
Old April 27th, 2003, 09:15 PM
madhombre madhombre is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: WI
Posts: 247 madhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: how can I get the width and height of a table cell

thanks I will try that and let you know

Reply With Quote
  #4  
Old April 27th, 2003, 09:47 PM
madhombre madhombre is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: WI
Posts: 247 madhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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.

Reply With Quote
  #5  
Old April 27th, 2003, 09:54 PM
madhombre madhombre is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: WI
Posts: 247 madhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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

Reply With Quote
  #6  
Old April 27th, 2003, 10:03 PM
madhombre madhombre is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: WI
Posts: 247 madhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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

Reply With Quote
  #7  
Old April 27th, 2003, 10:52 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
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

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > how can I get the width and height of a table cell


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway