I'm using the following code to create a small table with one column and
two rows. An image goes into the first cell.
//create table
var t = document.create Element("TABLE" );
t.style.positio n = "absolute";
t.style.left = "100px";
t.style.top = "100px";
t.style.width = "200px";
// create tbody
var b = document.create Element("b");
// add row
var r = document.create Element("TR");
// add cell
var c = document.create Element("TD");
c.setAttribute( "height","200") ;
// put image into cell
var i = document.create Element("IMG");
i.setAttribute( "src","pics/one.png");
c.appendChild(i );
r.appendChild(c );
b.appendChild(r );
// add row
var r = document.create Element("TR");
// add cell
c = document.create Element("TD");
// put text into cell
var txt = document.create TextNode("desc of image one");
c.appendChild(t xt);
r.appendChild(c );
b.appendChild(r );
// append to doc
t.appendChild(b );
document.body.a ppendChild(t);
This display fine (correctly?) in MZ but IE stretches the image to fit
the size of the cell. I'm actually picking the image dynamically so I
won't know it's size. Is there a way I can do this without the image
distorting?
Andrew Poulos
two rows. An image goes into the first cell.
//create table
var t = document.create Element("TABLE" );
t.style.positio n = "absolute";
t.style.left = "100px";
t.style.top = "100px";
t.style.width = "200px";
// create tbody
var b = document.create Element("b");
// add row
var r = document.create Element("TR");
// add cell
var c = document.create Element("TD");
c.setAttribute( "height","200") ;
// put image into cell
var i = document.create Element("IMG");
i.setAttribute( "src","pics/one.png");
c.appendChild(i );
r.appendChild(c );
b.appendChild(r );
// add row
var r = document.create Element("TR");
// add cell
c = document.create Element("TD");
// put text into cell
var txt = document.create TextNode("desc of image one");
c.appendChild(t xt);
r.appendChild(c );
b.appendChild(r );
// append to doc
t.appendChild(b );
document.body.a ppendChild(t);
This display fine (correctly?) in MZ but IE stretches the image to fit
the size of the cell. I'm actually picking the image dynamically so I
won't know it's size. Is there a way I can do this without the image
distorting?
Andrew Poulos
Comment