View Full Version : Retrieving Table & Cell attributes

10-02-2003, 07:17 PM
This stems from my original problem you can read about here:


You don't need to read that to help but anyway - if it can't be fixed using HTML i will need another (PHP) solution!

Anyway, my question:

Is there a way to retrieve the height/width of table cells as defined in HTML <table><tr> and <td> tags when they have active (and therefore resizing) content?

That way I could assign these values to variables and put them into my PHP code to create my own autoresizing table.

Any other possible solutions I would also like to hear!

10-02-2003, 07:25 PM
PHP runs on the server and not in the browser. Hence, it has no idea what autoresized tables are nor how to get at their respective witdth. You need a JavaScript solution to do exactly that.

Depending on how you generate the "active content", you could scan the "active content" for a potential HTML element (like an <img>) whose width is determined in the code (by setting the attribute) and calculate if it conflicts with the width of your table cell, but you can only do that *before* the file is sent to the browser.