mscir <ms***@access4less.com.net.org.uk> wrote in message news:<10*************@corp.supernews.com>...
Lan Vuong wrote: Hi Mike,
Thanks for the input but I need to get the cell size w/o having user
mouseover the cell. I'm creating the table dynamically so I need to
know when to start a new row by using the window width and cell size.
Any other ideas?
Thanks.
Please don't top post, it screws up the Q&A flow. Post your code that
generates the table.
Mike
Hi Mike,
I apologize for the delayed reply. I got pulled away to work on
something else and I'm just getting back to this code. I've included
some sample code below that demonstrates what I'm trying to do. I can
only get the table cell width once the table has been completely
generated but I'm trying to get it as I'm generating the cells/rows.
Please let me know if you have any other suggestions.
Thanks,
Lan
<html>
<script>
function dumpProps(targetID) {
alert('dumpProps');
var s1='';
var msg='';
obj=document.getElementById(targetID);
for (var i in obj) {
if (parent) {
msg = document + "." + i + "------------" + obj[i];
} else {
msg = i + "\n" + obj[i];
}
s1+='\n'+msg;
}
document.writeln(s1);
}
</script>
<table>
<tbody>
<tr>
<td onmouseover="alert(this.offsetWidth)" id="test"><a id="link"
href="#">DynamicCluster_A</a></td>
<script>
//this section returns zero
alert('offsetWidth=' + document.getElementById("test").offsetWidth);
alert('clientWidth=' + document.getElementById('test').clientWidth);
</script>
</tr>
</tbody>
</table>
<script>
//this section returns the correct value
alert('offsetWidth=' + document.getElementById("test").offsetWidth);
alert('clientWidth=' + document.getElementById('test').clientWidth);
</script>
</body>
</html>