Hi Crowder,

I am having some problem in implementing a dynamic table and getting the
width of an td element in IE (Safari, FF works ok.)
I am creating the table as :



var myTable = document.createElement("table");

var myThead = document.createElement("thead");
var myTfoot = document.createElement("tfoot");

var myTbody = document.createElement("tbody");

var myRow = document.createElement("tr");

var myCell = document.createElement("td");

myTable.appendChild(myThead);
myTable.appendChild(myTfoot);

myTable.appendChild(myTbody);

myTbody.appendChild(myRow);

myRow.appendChild(myCell);

this.containerElement.appendChild(myTable);

-------------------------------

I have a css file where I set up the style for the td element.

td.one
{
height:80px;
width:80px;
 border: 1px solid #000;
 background:#333;

vertical-align:middle;
voice-family: "\"}\"";
voice-family: inherit;
width: 78px; }

td { width:78px; } ,

----------------------

After running the the code, I could see that the table with one cell is
getting created correctly.  But if I try to get width, I am not getting
anything.

However, if I create the table in a static html code.  At least I can query
the element by :

var tdElem = this.containerElement.getElementsByTagName("td");

var colItem = tdElem.item(0);

var colWidth = colItem.style.width;

var colWidth = (col.item(0)).getWidth(); // not working in IE.  It is dying.

var colWidth = $$('td').getWidth();  // Not working if the table is created
dynamically

------------------------

This probably already an discussed topic.  I am wondering why is this
difference between statically and dynamically created table ?  Is there a
way to get width of the td element (created dynamically) that works in IE?
 I do not have any problem in getting getWidth() working for dynamically
created table in FF and Safari.

Any help is appreciated.

Thanks so much,

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to