View Single Post
Old 12-31-2012, 12:03 PM   PM User | #2
niralsoni
Regular Coder

 
Join Date: Mar 2008
Location: London
Posts: 129
Thanks: 1
Thanked 31 Times in 31 Posts
niralsoni is an unknown quantity at this point
Assuming "previews" is your table, it would be something like this -
(unwanted code has been commented out)

Code:
//var tbody = document.createElement('tbody');	
var link = document.createElement('a');
var span = document.createElement('span');
var txt = "EPSON GPS Receiver Module S4E398600010000";
var image = document.createElement('img');
//var tr = document.createElement('tr');
//var td = document.createElement('td');
link.setAttribute('href','#1');
span.setAttribute('class','editorialQuickLinkTitle');
link.innerHTML = txt;
span.appendChild(link);
image.setAttribute('src','/Images/Logos/Miniatures/epson.png');
image.setAttribute('border','0');
image.setAttribute('vspace','5');
image.setAttribute('hspace','5');
//td.setAttribute('class','block');
//td.appendChild(span);
//td.appendChild(document.createElement('br'));
//td.appendChild(image);
//tr.appendChild(td);
//tbody.appendChild(tr);
//document.getElementById("previews").appendChild(tbody);

var tbl = document.getElementById("previews");
var tr = tbl.insertRow(tbl.rows.length);
var td = tr.insertCell(tr.cells.length);
td.setAttribute('class','block');
td.appendChild(span);
td.appendChild(document.createElement('br'));
td.appendChild(image);
Hope it helps you out...

Regards,
Niral Soni
niralsoni is offline   Reply With Quote