Current location: Hot Scripts Forums » General Web Coding » JavaScript » determining the precise dimensions of a table cell


determining the precise dimensions of a table cell

Reply
  #1 (permalink)  
Old 06-19-04, 05:31 AM
davidklonski davidklonski is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
determining the precise dimensions of a table cell

Hello

Assuming that I have the following table definition:
Code:
<table border="0" cellpading="0" cellspacing="0">
  <tr>
    <td><!-- content --></td>
    <td><!-- content --></td>
    <td><!-- content --></td>
  </tr>
  <tr>
    <td><!-- content --></td>
    <td id="cell" width="100%" height="100%"><!-- content --></td>
    <td><!-- content --></td>
  </tr>
  <tr>
    <td><!-- content --></td>
    <td><!-- content --></td>
    <td><!-- content --></td>
  </tr>
</table>
Note that I have set the width and height of the middle cell to 100%.
Is there a way of knowing on the client-side (probably using Javascript) what is the actual width and height that cell is occupying in pixels?
Obviously, the width and height will be determined by the content of all the cells of the table. However, once the table is drawn, the cell will have a final width and height. I am looking for a way to get those dimensions.

I tried using: cell.style.pixelWidth & cell.style.pixelHeight but I am not getting anyting...

Thanks for the help in advance.
Reply With Quote
  #2 (permalink)  
Old 06-21-04, 12:45 AM
dawggy505 dawggy505 is offline
Newbie Coder
 
Join Date: May 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
try takin out the "pixel" in cell.style.pixelWidth
Reply With Quote
  #3 (permalink)  
Old 06-21-04, 03:41 AM
davidklonski davidklonski is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
I tried it as well, but I still wasn't able to get what I want.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validator ctrl in table cell : Strange behaviour sunny_doncaster ASP.NET 6 07-31-08 09:43 AM
determining the precise dimensions of a table cell davidklonski HTML/XHTML/XML 1 07-04-04 11:31 AM
auto table resize derick_2k JavaScript 4 04-26-04 02:32 PM
Fixing table cell height - dynamically resize column widths? ijg0 CSS 2 04-19-04 11:34 AM
Determine what cell in a table was clicked mtilori JavaScript 1 02-16-04 01:48 AM


All times are GMT -5. The time now is 10:24 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.